neilconway commented on code in PR #20224: URL: https://github.com/apache/datafusion/pull/20224#discussion_r2784214171
########## datafusion/sqllogictest/test_files/datetime/timestamps.slt: ########## @@ -5328,3 +5328,33 @@ drop table ts_data_secs statement ok drop table ts_data_micros_kolkata + +########## +## Test to_timestamp with scalar float inputs +########## + +statement ok +create table test_to_timestamp_scalar(id int, name varchar) as values + (1, 'foo'), + (2, 'bar'); + +query P +SELECT to_timestamp(123.5, name) FROM test_to_timestamp_scalar ORDER BY id; Review Comment: In the current implementation, the second and subsequent arguments are completely ignored, unless the first argument is a string. Passing format arguments when the first argument isn't a strict doesn't actually make much sense, and in fact Postgres only implements to variants: ``` to_timestamp(double) -> timestamptz to_timestamp(text, text) -> timestamptz ``` On that basis, I can revise this PR to reject attempts to pass two or more arguments when the first argument is not a string. Does that sound reasonable? -- 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]
