Я использую jaydebeapi для подключения к улью.
Я хочу выбрать первые 3 символа VARCHAR (100) с помощью куста.
У меня есть столбцы с именами col1 и col2. col1 - строка, а col2 - VARCHAR (100)
Когда я это делаю, все работает нормально:
connection = jaydebeapi.connect(class_name, url)
cursor = connection.cursor()
cursor.execute('use db1')
cursor.execute("select substr(col1, 1, 3) from table1")
data = cursor.fetchall()
print(data)
Однако, когда я пытаюсь сделать то же самое с col2, я получаю ошибка:
connection = jaydebeapi.connect(class_name, url)
cursor = connection.cursor()
cursor.execute('use db1')
cursor.execute("select substr(col2, 1, 3) from table1")
data = cursor.fetchall()
print(data)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/jaydebeapi/__init__.py", line 537, in execute
is_rs = self._prep.execute()
jpype._jexception.SQLExceptionPyRaisable: java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/test_query.py", line 50, in <module>
cursor.execute("select substr(col2, 1, 3) from table1")
File "/usr/local/lib/python3.7/site-packages/jaydebeapi/__init__.py", line 539, in execute
_handle_sql_exception()
File "/usr/local/lib/python3.7/site-packages/jaydebeapi/__init__.py", line 165, in _handle_sql_exception_jpype
reraise(exc_type, exc_info[1], exc_info[2])
File "/usr/local/lib/python3.7/site-packages/jaydebeapi/__init__.py", line 57, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.7/site-packages/jaydebeapi/__init__.py", line 537, in execute
is_rs = self._prep.execute()
jaydebeapi.InterfaceError: java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.tez.TezTask
Есть идеи, как решить эту проблему?