-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Deprecate and remove GenericAppenderFactory from tests #14353
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
Conversation
| Map<String, String> properties = table == null ? ImmutableMap.of() : table.properties(); | ||
| MetricsConfig metricsConfig = | ||
| table == null ? MetricsConfig.getDefault() : MetricsConfig.forTable(table); |
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.
need to handle null table, as a few use-cases for FileAppanderFactory uses it without an actual table
| import org.apache.iceberg.util.CharSequenceSet; | ||
| import org.apache.iceberg.util.CharSequenceWrapper; | ||
|
|
||
| class SortedPosDeleteWriter<T> implements FileWriter<PositionDelete<T>, DeleteWriteResult> { |
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.
not used, non public class.
Removed
| STRUCT_FIELD); | ||
|
|
||
| protected abstract FileAppender<T> writeAndGetAppender(List<Record> records) throws Exception; | ||
| protected abstract DataFile writeAndGetDataFile(List<Record> records) throws Exception; |
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.
Because of this change, we need to commit Spark 3.4/3.5, Flink 2.0/1.20 together, as all of them uses this as a base test. The other Spark and Flink versions are clean backports
| appender.addAll(records); | ||
| } finally { | ||
| appender.close(); | ||
| List<Record> records, File file, FileFormat fileFormat, Schema schema) throws IOException { |
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.
instead of the factory as an input, we create the factory internally using the schema information
| .collect(Collectors.toList()); | ||
| } | ||
|
|
||
| private static EncryptedOutputFile encrypt(OutputFile out) { |
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.
Made the one in FileHelpers public, and used it everywhere
| new GenericFileWriterFactory.Builder() | ||
| .dataSchema(table.schema()) | ||
| .dataFileFormat(format) | ||
| .writerProperties(writeProperties) |
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.
The sad truth is that this test is not checking if the bloom filters are actually configured/created or not.
| return DEFAULT; | ||
| } | ||
|
|
||
| public static MetricsConfig getPositionDelete() { |
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.
nit: maybe forPositionDelete()?
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 was debating the same. The getPositionDelete won narrowly, because of the getDefault.
But taking a look at it with fresh eyes the forPositionDelete seems better.
Updated.
|
Merged to main. |
No description provided.