-
Notifications
You must be signed in to change notification settings - Fork 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
(@aws-cdk.aws-glue-alpha): Glue table separator + skip header #23132
Comments
On a quick glance it doesn't look like this is supported on out L2, and will need to be done either with the L1 like you've done, or using escape hatches Source code:
As for the docs, this should be easy to fix by removing the repeated sentence from the README https://github.com/aws/aws-cdk/blob/v2.51.1/packages/%40aws-cdk/aws-glue/README.md |
i've never used escape hatches will have to read up on it, thanks for your response and the pointer @peterwoodworth! |
@markusl The const cfnTable = table.node.defaultChild as CfnTable;
cfnTable.addPropertyOverride("TableInput.Parameters", {
"skip.header.line.count": "1",
}); |
@WtfJoke Thanks! Edited my comment for clarity. Overriding |
@markusl yeah we tested this successfully. Are you sure the properties are visible as table properties? We have also serde properties overwritten: /*
Set additional serializer properties (since its not possible with the current L2 construct):
- Switch serializer from OpenCSV to LazySimpleSerDe (OpenCSV supports only string).
- Specify ',' as field separator (default is tab)
*/
cfnTable.addPropertyOverride("TableInput.StorageDescriptor.SerdeInfo", {
SerializationLibrary: "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe",
Parameters: {
"field.delim": ",",
},
}); |
Includes a `storageParameters` property, allowing developers to access the `tableInput.storageDescriptor.parameters` property within the `CfnTable` resource. Closes #23132. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the issue
I have created a glue-table using
DataFormat.CSV
with versionaws-cdk.aws-glue-alpha==2.51.1a0
and python3.7.13
. The code looks similar to:Now I'm trying to adjust the parameters
skip.header.line.count
andseparatorChar
. Specifically I want to skip the 1st row and use a semicolon separator.Using L1's, the code would look similar to:
Looked through the L2-documentation but couldn't find anything regarding this, any tips?
On a separate note, there is a repeating sentence in the documentation:
Links
https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_glue_alpha/README.html#table
The text was updated successfully, but these errors were encountered: