Hello teammates, I want to transfer my google-ana...
# troubleshooting
h
Hello teammates, I want to transfer my google-analytics data to AWS Athena. I have successful created tap for google analytics. Tested it. Worked fine with target-jsonl. However, when I am connecting my target-athena. It is give error. Can someone help me with this.
pyathena.error.DatabaseError: An error occurred (InvalidRequestException) when calling the StartQueryExecution operation: line 1:8: mismatched input 'EXTERNAL'. Expecting: 'OR', 'SCHEMA', 'TABLE', 'VIEW' cmd_type=elb consumer=True name=target-athena producer=False stdio=stderr string_id=target-athena
botocore.errorfactory.InvalidRequestException: An error occurred (InvalidRequestException) when calling the StartQueryExecution operation: line 1:8: mismatched input 'EXTERNAL'. Expecting: 'OR', 'SCHEMA', 'TABLE', 'VIEW' cmd_type=elb consumer=True name=target-athena producer=False stdio=stderr string_id=target-athena
a
Looks like it is failing due to a syntax issue when creating the external table. Do you see a full SQL command output in your logs? Probably would start with something "CREATE EXTERNAL TABLE ..." ...
Make sure table name does not have "-", spaces, or any other character not allowed in table names.
Could be that the target is not correctly conforming the stream name to a valid table name.
m
Athena uses Hive datatypes under the hood IIRC. Special characters in column names will break it - I agree with AJ that looking into those is worthwhile.
h
Oh yes, the issue was with naming of table, it contained spaces. Solved it. Thanks for prompt help guys ❤️