yaooqinn commented on issue #26520: [SPARK-29896][SQL] Extend typed literals support for all spark native types URL: https://github.com/apache/spark/pull/26520#issuecomment-554175352 # mysql only date, time types support this, string literals support a character set prefix, numeric and boolean ones does support it. ```sql ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallint '1'' at line 1 mysql> select TINYINT '1'; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TINYINT '1'' at line 1 mysql> SELECT timestamp '2019-11-15 00:00:00'; +---------------------------------+ | timestamp '2019-11-15 00:00:00' | +---------------------------------+ | 2019-11-15 00:00:00 | +---------------------------------+ 1 row in set (0.00 sec) mysql> SELECT date '2019-11-15'; +-------------------+ | date '2019-11-15' | +-------------------+ | 2019-11-15 | +-------------------+ 1 row in set (0.00 sec) mysql> SELECT _utf8'some text'; +-----------+ | some text | +-----------+ | some text | +-----------+ 1 row in set, 1 warning (0.00 sec) mysql> SELECT _latin1'string'; +--------+ | string | +--------+ | string | +--------+ 1 row in set (0.00 sec) mysql> select boolean 'true'; ERROR 1054 (42S22): Unknown column 'boolean' in 'field list' mysql> select bool 'true'; ERROR 1054 (42S22): Unknown column 'bool' in 'field list' ```
---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
