You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LEFT ( character_expression , integer_expression )
character_expression
Is an expression of character or binary data. character_expression can be a constant, variable, or column. character_expression can be of any data type, except text or ntext, that can be implicitly converted to varchar or nvarchar. Otherwise, use the CAST function to explicitly convert character_expression.
Running the translated result in AWS Athena, we get:
FUNCTION_NOT_FOUND: line 1:26: Unexpected parameters (integer) for function length. Expected: length(varchar(x)), length(char(x)), length(varbinary)
We need to cast the argument for LENGTH in order to support the specification
Thanks, still hope this isn't too annoying. I'm dealing with a large codebase of MSSQL queries, so that's why I keep coming back with issues :). But it's actually quite magical to see how almost everything works without requiring modifications
The text was updated successfully, but these errors were encountered:
@joshnatis would appreciate it if you took the time to learn the code base to do these easy transpilations in the future. that way you can become a contributor! happy to help :)
Hi Toby and friends. This is a very similar issue to #2885, except regarding the
LEFT
andRIGHT
functions instead of theLEN
function.T-SQL
As seen above, T-SQL accepts non-varchar data as arguments for its
LEFT
andRIGHT
functions. The documentation explicitly documents this this time:https://learn.microsoft.com/en-us/sql/t-sql/functions/left-transact-sql?view=sql-server-ver16
Trino
Running the translated result in AWS Athena, we get:
We need to cast the argument for
LENGTH
in order to support the specificationThanks, still hope this isn't too annoying. I'm dealing with a large codebase of MSSQL queries, so that's why I keep coming back with issues :). But it's actually quite magical to see how almost everything works without requiring modifications
The text was updated successfully, but these errors were encountered: