@@ -482,8 +482,10 @@ static ColumnWithTypeAndName readColumnWithGeoData(const std::shared_ptr<arrow::
482482 {
483483 auto * raw_data = buffer->mutable_data () + chunk.value_offset (offset_i);
484484 if (chunk.IsNull (offset_i))
485- throw Exception (ErrorCodes::BAD_ARGUMENTS, " Geometry nullable columns are not supported" );
486-
485+ {
486+ column_builder.appendDefault ();
487+ continue ;
488+ }
487489 ReadBuffer in_buffer (reinterpret_cast <char *>(raw_data), chunk.value_length (offset_i), 0 );
488490 ArrowGeometricObject result_object;
489491 switch (geo_metadata.encoding )
@@ -789,6 +791,7 @@ struct ReadColumnFromArrowColumnSettings
789791 bool skip_columns_with_unsupported_types;
790792 bool allow_inferring_nullable_columns;
791793 bool case_insensitive_matching;
794+ bool allow_geoparquet_parser;
792795};
793796
794797static ColumnWithTypeAndName readColumnFromArrowColumn (
@@ -846,7 +849,7 @@ static ColumnWithTypeAndName readNonNullableColumnFromArrowColumn(
846849 break ;
847850 }
848851 }
849- if (geo_metadata)
852+ if (geo_metadata && settings. allow_geoparquet_parser )
850853 {
851854 return readColumnWithGeoData (arrow_column, column_name, *geo_metadata);
852855 }
@@ -1324,7 +1327,8 @@ Block ArrowColumnToCHColumn::arrowSchemaToCHHeader(
13241327 const std::string & format_name,
13251328 bool skip_columns_with_unsupported_types,
13261329 bool allow_inferring_nullable_columns,
1327- bool case_insensitive_matching)
1330+ bool case_insensitive_matching,
1331+ bool allow_geoparquet_parser)
13281332{
13291333 ReadColumnFromArrowColumnSettings settings
13301334 {
@@ -1333,7 +1337,8 @@ Block ArrowColumnToCHColumn::arrowSchemaToCHHeader(
13331337 .allow_arrow_null_type = false ,
13341338 .skip_columns_with_unsupported_types = skip_columns_with_unsupported_types,
13351339 .allow_inferring_nullable_columns = allow_inferring_nullable_columns,
1336- .case_insensitive_matching = case_insensitive_matching
1340+ .case_insensitive_matching = case_insensitive_matching,
1341+ .allow_geoparquet_parser = allow_geoparquet_parser
13371342 };
13381343
13391344 ColumnsWithTypeAndName sample_columns;
@@ -1371,13 +1376,15 @@ ArrowColumnToCHColumn::ArrowColumnToCHColumn(
13711376 bool allow_missing_columns_,
13721377 bool null_as_default_,
13731378 FormatSettings::DateTimeOverflowBehavior date_time_overflow_behavior_,
1379+ bool allow_geoparquet_parser_,
13741380 bool case_insensitive_matching_,
13751381 bool is_stream_)
13761382 : header (header_)
13771383 , format_name (format_name_)
13781384 , allow_missing_columns (allow_missing_columns_)
13791385 , null_as_default (null_as_default_)
13801386 , date_time_overflow_behavior (date_time_overflow_behavior_)
1387+ , allow_geoparquet_parser (allow_geoparquet_parser_)
13811388 , case_insensitive_matching (case_insensitive_matching_)
13821389 , is_stream (is_stream_)
13831390{
@@ -1421,7 +1428,8 @@ Chunk ArrowColumnToCHColumn::arrowColumnsToCHChunk(
14211428 .allow_arrow_null_type = true ,
14221429 .skip_columns_with_unsupported_types = false ,
14231430 .allow_inferring_nullable_columns = true ,
1424- .case_insensitive_matching = case_insensitive_matching
1431+ .case_insensitive_matching = case_insensitive_matching,
1432+ .allow_geoparquet_parser = allow_geoparquet_parser
14251433 };
14261434
14271435 Columns columns;
0 commit comments