wangyum commented on a change in pull request #24862: [SPARK-28038][SQL][TEST] Port text.sql URL: https://github.com/apache/spark/pull/24862#discussion_r308508770
########## File path: sql/core/src/test/resources/sql-tests/inputs/pgSQL/text.sql ########## @@ -0,0 +1,134 @@ +-- +-- Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group +-- +-- +-- TEXT +-- https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/sql/text.sql + +SELECT string('this is a text string') = string('this is a text string') AS true; + +SELECT string('this is a text string') = string('this is a text strin') AS `false`; + +CREATE TABLE TEXT_TBL (f1 string) USING parquet; + +INSERT INTO TEXT_TBL VALUES ('doh!'); +INSERT INTO TEXT_TBL VALUES ('hi de ho neighbor'); + +SELECT '' AS two, * FROM TEXT_TBL; + +-- As of 8.3 we have removed most implicit casts to text, so that for example +-- this no longer works: +-- Spark SQL implicit cast integer to string +select length(42); + +-- But as a special exception for usability's sake, we still allow implicit +-- casting to text in concatenations, so long as the other input is text or +-- an unknown literal. So these work: +-- [SPARK-28033] String concatenation low priority than other arithmeticBinary +select string('four: ') || 2+2; +select string('four: ') || 2+2; Review comment: Update it to `select 'four: ' || 2+2;`? https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/sql/text.sql#L25-L26 ---------------------------------------------------------------- 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]
