Common Bodo SQL Errors¶
BodoSQL can raise a number of different errors when parsing SQL queries. This page contains a list of the most commonly encountered parsing errors and their causes.
-
A binary operation was used on two types for which it is not supported.
This error can be resolved by casting either side of the expression to a common type.
-
The format string passed to STR_TO_DATE is not a valid SQL format string.
See
DATE_FORMAT
for the list of supported SQL format characters.
-
The format string passed to STR_TO_DATE is a valid SQL format string, which contains one or more escape characters that BodoSQL does not currently support.
For the list of supported SQL format characters, see
DATE_FORMAT
.
-
The specified column (
COL_NAME
) of one of the pandas DataFrames used to initialize a BodoSQLContext has an unsupported type.For the list of supported pandas types, see here.
-
The parser encountered something other than a query at a location where a query was expected.
See here for the syntax of a select clause.
-
The table name specified in a SQL query doesn't match a table name registered in the BodoSQLContext.
Generally, this is caused by misnaming a table when initializing the BodoSqlContext, or misnaming a table in the query itself.
-
The query attempted to select a column from one or more tables, and the column wasn't present in any of them.
Generally, this is caused by misnaming a column while initializing the BodoSQLContext, or misnaming a column in the query itself.``
-
The query attempted to select a column for two or more tables, and the column was present in multiple tables.
-
The types of arguments supplied to the function don't match the types supported by the function.
"Cannot apply 'FN_NAME' to arguments of type 'FN_NAME(<ARG1_SQL_TYPE>, <ARG2_SQL_TYPE>, ...)'. Supported form(s): 'FN_NAME(<ARG1_SQL_TYPE>, <ARG2_SQL_TYPE>, ...)'"
Generally, this can be resolved by the specifying the origin table like so:
Select A from table1, table2
→Select table1.A from table1, table2
This can be resolved by explicitly casting the problematic argument(s) to the appropriate type. For the list of functions and the argument types they support, see here.
-
Either BodoSQL doesn't support the function or an incorrect number of arguments was supplied.
In both cases, the list of functions which we support, and their calling conventions can be found here.
-
A Window function that does not support windows with a
ROWS_BETWEEN
clause was called over a window containing aROWS_BETWEEN
clause.In addition to the RANK, DENSE_RANK, or ROW_NUMBER functions listed in the error message, LEAD and LAG also have this requirement. The list of window aggregations we support, and their calling syntax can be found here.
-
BodoSQL was unable to parse your SQL because the query contained unsupported syntax.
There are a variety of reasons this could occur, but here are some of the common ones:
- A typo in one of the query words, for example
groupby
instead ofgroup by
. In this situationline X, column Y
should point you to the first typo. - All the components are legal SQL keywords, but they are used in an incorrect order. Please refer to our support syntax to check for legal constructions. If you believe your query should be supported please file an issue.
- Trying to use double-quotes for a string literal (i.e.
py"example"
instead of'example'
) - Unclosed parenthesis or trailing commas
- A typo in one of the query words, for example
-
A parameter was not properly registered in the BodoSQLContext.
This is often caused by failing to pass the parameter to
BodoSQLContext.sql()
or using an incorrect name in either the query or the registration. For more information on named parameters, see here.
-
A non-dataframe value was used to initialize a BodoSQLContext.
The dictionary used to initialize a BodoSQLContext must map string table names to pandas DataFrames.