ankitajhanwar2001 commented on code in PR #36747:
URL: https://github.com/apache/superset/pull/36747#discussion_r2635594510
##########
tests/unit_tests/sql/parse_tests.py:
##########
@@ -2891,6 +2891,20 @@ def test_singlestore_engine_mapping():
assert "COUNT(*)" in formatted
+def test_awsathena_engine_mapping():
+ """
+ Test the `awsathena` dialect is properly mapped to ATHENA instead of
PRESTO.
+ """
+ sql = (
+ "USING EXTERNAL FUNCTION my_func(x INT) RETURNS INT LAMBDA
'lambda_name' "
+ "SELECT my_func(id) FROM my_table"
+ )
+ statement = SQLStatement(sql, engine="awsathena")
+
+ # Should parse without errors using Athena dialect
Review Comment:
Thanks for the suggestion.
`statement.is_select()` is intentionally not asserted here because SQLGlot
currently parses `USING EXTERNAL FUNCTION ... SELECT ...` as a generic Command,
even under the Athena dialect. The test’s goal is to ensure Athena-specific
syntax is accepted and not rejected during parsing, rather than enforcing a
SELECT AST classification.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]