-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parquet: Add system config for unsafe Parquet ID fallback. #9324
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,7 @@ | |
import org.apache.iceberg.SchemaParser; | ||
import org.apache.iceberg.SortOrder; | ||
import org.apache.iceberg.StructLike; | ||
import org.apache.iceberg.SystemConfigs; | ||
import org.apache.iceberg.Table; | ||
import org.apache.iceberg.avro.AvroSchemaUtil; | ||
import org.apache.iceberg.data.parquet.GenericParquetWriter; | ||
|
@@ -1166,27 +1167,29 @@ public <D> CloseableIterable<D> build() { | |
|
||
ParquetReadOptions options = optionsBuilder.build(); | ||
|
||
NameMapping mapping; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Optional: You could also check the system property when picking the default value in the constructor or add a method called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went to add this, but then I thought it was a bit confusing to have both the field and method. I think it should be okay to have an extra variable. |
||
if (nameMapping != null) { | ||
mapping = nameMapping; | ||
} else if (SystemConfigs.NETFLIX_UNSAFE_PARQUET_ID_FALLBACK_ENABLED.value()) { | ||
mapping = null; | ||
} else { | ||
mapping = NameMapping.empty(); | ||
} | ||
|
||
if (batchedReaderFunc != null) { | ||
return new VectorizedParquetReader<>( | ||
file, | ||
schema, | ||
options, | ||
batchedReaderFunc, | ||
nameMapping, | ||
mapping, | ||
filter, | ||
reuseContainers, | ||
caseSensitive, | ||
maxRecordsPerBatch); | ||
} else { | ||
return new org.apache.iceberg.parquet.ParquetReader<>( | ||
file, | ||
schema, | ||
options, | ||
readerFunc, | ||
nameMapping, | ||
filter, | ||
reuseContainers, | ||
caseSensitive); | ||
file, schema, options, readerFunc, mapping, filter, reuseContainers, caseSensitive); | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure including Netflix in the property name gives us any benefit. I'd consider just calling it any of these:
Up to you, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like having Netflix in the name because it signals that people should not use this. It is not a feature, it is an artifact of Iceberg's history.