srielau commented on PR #38685:
URL: https://github.com/apache/spark/pull/38685#issuecomment-1321215985
> > But is COLUMN_ALREADY_EXISTS the best choice for CREATE TABLE or WITH
cte(c1, c1) AS?
> > How about AS T(c1, c1)
>
> @srielau I assumed that we will provide a query context which should point
out to the problematic part.
Sure, but will every tool look at it? By that token we don't need most of
the payload for various errors.
Either way, that is not the main point. The main question is whether we
should have a distinct error messages for duplicate identifier in
"constructors". We apparently allow duplicate attribute names in structs (?)..
Should this say: MAP_KEY_ALREADY_EXISTS
spark-sql> select map('a', 5, 'a', 6);
Duplicate map key a was found
I just checked CTE and table alias. Neither enforce unique names, which is
curious.
So I suppose the question boils down to CREATE TABLE and CREATE VIEW.
--
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]