33
33
import static com .facebook .presto .iceberg .IcebergQueryRunner .createIcebergQueryRunner ;
34
34
import static com .facebook .presto .iceberg .IcebergQueryRunner .getIcebergDataDirectoryPath ;
35
35
import static java .lang .String .format ;
36
+ import static org .apache .iceberg .TableProperties .SPLIT_SIZE_DEFAULT ;
36
37
import static org .testng .Assert .assertEquals ;
37
38
38
39
public class TestSetTablePropertyProcedure
@@ -64,21 +65,21 @@ public void testSetTablePropertyProcedurePositionalArgs()
64
65
String tableName = "table_property_table_test" ;
65
66
createTable (tableName );
66
67
try {
67
- String propertyKey = "read.split.planning-lookback " ;
68
+ String propertyKey = "read.split.target-size " ;
68
69
String propertyValue = "268435456" ;
69
70
assertUpdate ("INSERT INTO " + tableName + " VALUES (1, 'a')" , 1 );
70
71
71
72
Table table = loadTable (tableName );
72
73
table .refresh ();
73
74
74
75
assertEquals (table .properties ().size (), 8 );
75
- assertEquals (table .properties ().get (propertyKey ), null );
76
+ assertEquals (Long . parseLong ( table .properties ().get (propertyKey )), SPLIT_SIZE_DEFAULT );
76
77
77
78
assertUpdate (format ("CALL system.set_table_property('%s', '%s', '%s', '%s')" , TEST_SCHEMA , tableName , propertyKey , propertyValue ));
78
79
table .refresh ();
79
80
80
81
// now the table property read.split.target-size should have new value
81
- assertEquals (table .properties ().size (), 9 );
82
+ assertEquals (table .properties ().size (), 8 );
82
83
assertEquals (table .properties ().get (propertyKey ), propertyValue );
83
84
}
84
85
finally {
@@ -92,22 +93,22 @@ public void testSetTablePropertyProcedureNamedArgs()
92
93
String tableName = "table_property_table_arg_test" ;
93
94
createTable (tableName );
94
95
try {
95
- String propertyKey = "read.split.planning-lookback " ;
96
+ String propertyKey = "read.split.target-size " ;
96
97
String propertyValue = "268435456" ;
97
98
assertUpdate ("INSERT INTO " + tableName + " VALUES (1, 'a')" , 1 );
98
99
99
100
Table table = loadTable (tableName );
100
101
table .refresh ();
101
102
102
103
assertEquals (table .properties ().size (), 8 );
103
- assertEquals (table .properties ().get (propertyKey ), null );
104
+ assertEquals (Long . parseLong ( table .properties ().get (propertyKey )), SPLIT_SIZE_DEFAULT );
104
105
105
106
assertUpdate (format ("CALL system.set_table_property(schema => '%s', key => '%s', value => '%s', table_name => '%s')" ,
106
107
TEST_SCHEMA , propertyKey , propertyValue , tableName ));
107
108
table .refresh ();
108
109
109
110
// now the table property read.split.target-size should have new value
110
- assertEquals (table .properties ().size (), 9 );
111
+ assertEquals (table .properties ().size (), 8 );
111
112
assertEquals (table .properties ().get (propertyKey ), propertyValue );
112
113
}
113
114
finally {
0 commit comments