You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/07/21 14:40:30 UTC

[GitHub] [spark] maropu commented on pull request #29152: [SPARK-32356][SQL] Forbid create view with null type

maropu commented on pull request #29152:
URL: https://github.com/apache/spark/pull/29152#issuecomment-661902376


   hm, at least, most databases can accpet it `create view v as select null`, but `null` is regared as another type, e.g., a text in postgresql;
   ```
   postgres=# create view v as select null;
   CREATE VIEW
   postgres=# \d v
                    View "public.v"
     Column  | Type | Collation | Nullable | Default 
   ----------+------+-----------+----------+---------
    ?column? | text |           |          | 
   ```
   MySQL: http://sqlfiddle.com/#!9/42febe/1/0
   SQLite: http://sqlfiddle.com/#!7/42feb/1/0
   
   So, IMO accepting it looks somewhat meaningful to follow other databases, but we don't need to handle it as a null type. Either way, I think its better to update the migration guide if we change thsi behaivour.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org