-
Notifications
You must be signed in to change notification settings - Fork 57
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
Integration data type test for new table format #850
Conversation
src/test/java/net/snowflake/ingest/streaming/internal/datatypes/AbstractDataTypeTest.java
Outdated
Show resolved
Hide resolved
src/test/java/net/snowflake/ingest/streaming/internal/datatypes/IcebergDataTypeTest.java
Outdated
Show resolved
Hide resolved
src/test/java/net/snowflake/ingest/streaming/internal/datatypes/IcebergDataTypeTest.java
Outdated
Show resolved
Hide resolved
|
||
@Test | ||
public void testBoolean() throws Exception { | ||
testIcebergIngestion("boolean", true, new BooleanProvider()); |
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: whenever you have time in the next few weeks, lets introduce a class called ITTestcaseBuilder that has methods withDataType, withInputValue, withExpectedValue, withVerificationQuery.
THe provider business is funky as it only supports doing exact value verification with a where value = {expectedValue}
. I'd much rather write the sql filter directly in the testcase instead of have code generate it, for flexibility.
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.
Added to jira
src/test/java/net/snowflake/ingest/streaming/internal/datatypes/IcebergDataTypeTest.java
Outdated
Show resolved
Hide resolved
return tableName; | ||
} | ||
|
||
protected String createIcebergTable(String dataType) throws SQLException { |
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.
also add an argument for boolean nullable
and we can make sure the sdk does proper nullability checking for columns marked non-nullable.
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.
Added nullable test.
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 see nullable was removed, why so?
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.
Removed and use <datatype> not null
in datatype testing. By doing this we can set nullable on any sub-columns on structured data type.
Assert.assertThrows( | ||
SFException.class, | ||
() -> testIcebergIngestion("boolean", new Object(), true, new BooleanProvider())); | ||
Assert.assertEquals(ErrorCode.INVALID_FORMAT_ROW.getMessageCode(), ex.getVendorCode()); |
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.
(dupe) lets add nullability tests too - sending in null should work for every column, but when its a non-null column then the sdk should throw.
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.
Added nullable test for non structured data type. Will fix structured data type null count in next PR.
src/test/java/net/snowflake/ingest/streaming/internal/datatypes/IcebergDataTypeTest.java
Outdated
Show resolved
Hide resolved
ea6378d
to
e44c723
Compare
/** Whether the column is an Iceberg column */ | ||
private final boolean isIcebergColumn; | ||
/** Primitive type of the column, only used for Iceberg columns */ | ||
private final PrimitiveType primitiveType; |
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.
pl update the PR description to explain there's a bug fix in this PR too.
src/main/java/net/snowflake/ingest/streaming/internal/AbstractRowBuffer.java
Show resolved
Hide resolved
src/main/java/net/snowflake/ingest/streaming/internal/RowBufferStats.java
Outdated
Show resolved
Hide resolved
src/test/java/net/snowflake/ingest/streaming/internal/datatypes/IcebergDataTypeIT.java
Outdated
Show resolved
Hide resolved
1. Remove hidden polymorphic behavior of RowBufferStats, 2. remove isIceberg 3. Refactoring in FileColumnProperties - @sfc-gh-alhuang For strings, i see that there is a truncateUp for the Max stat and truncateDown for min stat. Please reivew this part carefully and compare with what it used to be before we started making changes, want to make sure we aren't regressing FDNs on this front.
@sfc-gh-hmadan Confirmed that the string min/max values for Iceberg table EP info also apply the 32 bytes round down/up truncate as FDN did. |
fbc4210
to
592b788
Compare
FileColumnProperties
. The Iceberg mode will fill in default value for corresponding type now if all values in the column are null.AbstractDataTypeTest.testIcebergIngestAndQuery
for multi row testing.