Skip to content

Retrieving structured data from complex type column #2686

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

Closed
eatonphil opened this issue Jul 8, 2019 · 1 comment
Closed

Retrieving structured data from complex type column #2686

eatonphil opened this issue Jul 8, 2019 · 1 comment
Labels
guidance Question that needs advice or information.

Comments

@eatonphil
Copy link

Version of AWS SDK for Go?

1.19.0

Version of Go (go version)?

go version go1.12 linux/amd64

What issue did you see?

The VarCharValue field on the Datum struct does not appear to be parseable when dealing with maps. Here is example output of some Datum's VarCharValue field:

{message_fields={message=An illegitimate escalation of privileges was detected in the program "/usr/sbin/sshd", which violated the policy., uuid=458cf903-929b-4522-9ef2-397334856a05, timestamp=2019-07-04T14:13:46.65326686Z}

String values are not quoted even when they contain spaces and commas (see the message field). So it does not seem possible to retrieve structured data from a Datum value. (Would have
same issue if an Array's value contained a comma and space.)

Am I misunderstanding the API? Is there another way to pull structured data from a Datum value? Or are there parsing rules that I am not picking up?

Thank you!

Steps to reproduce

Populate an athena table with a map column and attempt to query it using the Go api. Have key-value pair where the value contains a comma followed by a space. The VarCharValue field is not parseable since strings are not quoted.

@diehlaws diehlaws self-assigned this Jul 12, 2019
@diehlaws diehlaws added the guidance Question that needs advice or information. label Jul 12, 2019
@diehlaws
Copy link
Contributor

Thanks for reaching out to us @eatonphil. Is the field you've included a VARCHAR in its entirety, or is a specific component of this field being cast as a VARCHAR? If the data type of the provided field is a MAP you should be able to select each member of the map independently in the query, or cast each member of the map as a given data type to then parse individually. Seeing a code sample would allow us to better understand how exactly you're interacting with Athena using the AWS SDK for Go to retrieve this data so we can better assist with this.

@diehlaws diehlaws added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. closing-soon This issue will automatically close in 4 days unless further comments are made. and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Jul 12, 2019
@diehlaws diehlaws removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jul 19, 2019
@diehlaws diehlaws removed their assignment Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information.
Projects
None yet
Development

No branches or pull requests

2 participants