@@ -38,7 +38,8 @@ public class QueryParser {
38
38
// Otherwise NULLs will be substituted with default values.
39
39
// Currently supported only for 'mysql' table function.
40
40
private static final String PARAM_EXT_TABLE_USE_NULLS = "external_table_functions_use_nulls" ;
41
- private static final String PARAM_COLUMNS = "sample_block" ;
41
+ private static final String PARAM_COLUMNS = "columns" ;
42
+ private static final String PARAM_SAMPLE_BLOCK = "sample_block" ;
42
43
private static final String PARAM_QUERY = "query" ;
43
44
private static final String PARAM_DB_NAME = "db_name" ;
44
45
private static final String PARAM_TABLE_NAME = "table_name" ;
@@ -260,8 +261,12 @@ public static QueryParser fromRequest(RoutingContext ctx, Repository<NamedDataSo
260
261
261
262
String uri = Objects .requireNonNull (resolver ).resolve (req .getParam (PARAM_CONNECTION_STRING ));
262
263
if (forWrite ) {
263
- query = new QueryParser (uri , req .getParam (PARAM_DB_NAME ), req .getParam (PARAM_TABLE_NAME ),
264
- req .getParam (PARAM_COLUMNS ), req .getParam (PARAM_FORMAT_NAME ), null , null );
264
+ String columns = req .getParam (PARAM_SAMPLE_BLOCK );
265
+ if (columns == null ) {
266
+ columns = req .getParam (PARAM_COLUMNS );
267
+ }
268
+ query = new QueryParser (uri , req .getParam (PARAM_DB_NAME ), req .getParam (PARAM_TABLE_NAME ), columns ,
269
+ req .getParam (PARAM_FORMAT_NAME ), null , null );
265
270
} else {
266
271
String schema = req .getParam (PARAM_SCHEMA );
267
272
String table = req .getParam (PARAM_TABLE );
@@ -287,7 +292,10 @@ public static QueryParser fromRequest(RoutingContext ctx, Repository<NamedDataSo
287
292
}
288
293
289
294
if (columns == null ) {
290
- columns = req .getParam (PARAM_COLUMNS );
295
+ columns = req .getParam (PARAM_SAMPLE_BLOCK );
296
+ if (columns == null ) {
297
+ columns = req .getParam (PARAM_COLUMNS );
298
+ }
291
299
}
292
300
293
301
if (schema == null ) {
0 commit comments