Skip to content

Conversation

@natsukawa-kanou
Copy link
Contributor

some bugs fixed:

  • if identity transform, duplicated column name and will fail
  • use full column name, y.z instead of z
  • convert null to "unknown" to avoid null pointer error
  • improve dedupe logic

@jackye1995 @yyanyy

Copy link
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, we definitely missed a lot of edge cases here. Could you add more tests, and also add integration tests for this? If you don't have an AWS environment to run, I can run it after you publish.

return ImmutableMap.of(ICEBERG_FIELD_USAGE, fieldUsage,
ICEBERG_FIELD_TYPE_TYPE_ID, field.type().typeId().toString(),
ICEBERG_FIELD_TYPE_STRING, toTypeString(field.type()),
ICEBERG_FIELD_TYPE_TYPE_ID, safeString(field.type().typeId().toString()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this cannot avoid a null because you are already calling toString()

import org.slf4j.LoggerFactory;
import software.amazon.awssdk.services.glue.model.Column;
import software.amazon.awssdk.services.glue.model.DatabaseInput;
import software.amazon.awssdk.services.glue.model.Schedule;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused dependency

@jackye1995 jackye1995 added this to the Iceberg 0.13.0 Release milestone Jan 13, 2022
@jackye1995
Copy link
Contributor

Discussed with Kanou offline, it seems like the current way of exposing schema is too complex, and we will start simple and remove the partition spec part of it, and also remove some unnecessary annotations. Kanou will provide the update soon.

}

private static void addColumnWithDedupe(List<Column> columns, Set<String> dedupe,
NestedField field, String fieldName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fieldName parameter is not necessary, it's always field.name()

return ImmutableMap.of(ICEBERG_FIELD_USAGE, fieldUsage,
ICEBERG_FIELD_TYPE_TYPE_ID, field.type().typeId().toString(),
ICEBERG_FIELD_TYPE_STRING, toTypeString(field.type()),
private static Map<String, String> convertToParameters(NestedField field) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method can be combined to addColumnWithDedupe for simplicity

@jackye1995
Copy link
Contributor

thanks, mostly look good to me, I will verify the aws integration test while CI is running.

@jackye1995
Copy link
Contributor

confirmed AWS integ test successful. Waiting for CI

Copy link
Contributor

@jackye1995 jackye1995 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the work and quick fix, and congrats to the first PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants