Fix partitioning in Iceberg on varbinary column#10214
Merged
findepi merged 1 commit intotrinodb:masterfrom Dec 9, 2021
Merged
Conversation
findepi
reviewed
Dec 8, 2021
| if (type.typeId() == FIXED || type.typeId() == BINARY) { | ||
| // this is safe because Iceberg PartitionData directly wraps the byte array | ||
| partitionValue = new String(((ByteBuffer) value).array(), UTF_8); | ||
| partitionValue = StandardCharsets.ISO_8859_1.decode(Base64.getEncoder().encode((ByteBuffer) value)).toString(); |
Member
There was a problem hiding this comment.
- use
Base64.getEncoder().encodeToStringinstead ofStandardCharsets.ISO_8859_1.decode - does the comment in the preceding line require an update?
Member
Author
There was a problem hiding this comment.
- sure
- The comment seems to be valid.
| public void testSparkReadsTrinoPartitionedTable(StorageFormat storageFormat) | ||
| { | ||
| String baseTableName = "test_spark_reads_trino_partitioned_table_" + storageFormat; | ||
| String baseTableName = "test_spark_reads_trino_partitioned_table_5" + storageFormat; |
| .containsOnly(row1); | ||
|
|
||
| Row row2 = row("a", new byte[]{15, -15, 2, -16, -2, -1}, 1001); | ||
| String selectByVarbinaryTrino = "SELECT * FROM %s WHERE _varbinary = X'0ff102f0feff'"; //for now this fails on spark see https://githubmemory.com/repo/apache/iceberg/issues/2934 |
Member
There was a problem hiding this comment.
link to apache/iceberg#2934 instead
selectByVarbinaryTrino -> selectByVarbinary
(otherwise commenting that "trino select doesn't work in spark" is weird)
also, add assertQueryFailure
Member
There was a problem hiding this comment.
also, add
assertQueryFailure
... with onSpark()
bump
| .containsOnly(row1); | ||
|
|
||
| Row row2 = row("c", new byte[]{15, -15, 2, -3, -2, -1}, 1003); | ||
| String selectByVarbinaryTrino = "SELECT * FROM %s WHERE _varbinary = X'0ff102fdfeff'"; //for now this fails on spark see https://githubmemory.com/repo/apache/iceberg/issues/2934 |
2ef9013 to
fdeb485
Compare
Member
Author
|
@findepi comments addressed |
findepi
reviewed
Dec 8, 2021
...roduct-tests/src/main/java/io/trino/tests/product/iceberg/TestIcebergSparkCompatibility.java
Outdated
Show resolved
Hide resolved
fdeb485 to
289ccea
Compare
findepi
approved these changes
Dec 8, 2021
fixes trinodb#9755 Econding on the read path was different than encoding on the write path which resulted in different results. Now it is the same and it compatible with spark iceberg
289ccea to
bbbc14d
Compare
findepi
approved these changes
Dec 8, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #9755
Econding on the read path was different than encoding on the write path
which resulted in different results. Now it is the same and it compatible
with spark iceberg