aliyun/aliyun-apsaradb-hbase-demo

Two Problems while use py api to connect lindorm

Closed this issue · 0 comments

When I use python demo (aliyun-apsaradb-hbase-demo/lindormsql-python/demo.py ) to connect Lindorm and try to upsert batch data, there are some problems.

My local env is py3.8 in M1 MacBook Pro. And phoenixdb in version 1.1.0.

I found there are two problems in Line 29 and 52.

Line 29:

upsert into test_python(c1, c2) values(?,?)
Traceback (most recent call last):
  File "/Users/yt/PyProjects/PyConnLindorm/demo.py", line 43, in <module>
    stat.executemany(sql_upsert, [(3, 3), (4, 4)])
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/cursor.py", line 249, in executemany
    return self._connection._client.execute_batch(
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 559, in execute_batch
    response_data = self._apply(request)
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 227, in _apply
    parse_error_protobuf(response_body)
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 128, in parse_error_protobuf
    raise_sql_error(err.error_code, err.sql_state, err.error_message)
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 96, in raise_sql_error
    raise errors.InternalError(message, code, sqlstate)
phoenixdb.errors.InternalError: ('RuntimeException: java.sql.SQLException: addBatch not supported -> SQLException: addBatch not supported', 4294967295, '00000', None)
Exception ignored in: <function Connection.__del__ at 0x101e85940>
Traceback (most recent call last):
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/connection.py", line 60, in __del__
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/connection.py", line 114, in close
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 397, in close_connection
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 214, in _apply
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/google/protobuf/internal/python_message.py", line 1086, in SerializeToString
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/google/protobuf/internal/python_message.py", line 1095, in SerializePartialToString
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/google/protobuf/internal/python_message.py", line 1107, in InternalSerialize
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/google/protobuf/descriptor.py", line 166, in GetOptions
ImportError: sys.meta_path is None, Python is likely shutting down

Why "addBatch not supported"?

And problem in line 52:

offline table test_python
Traceback (most recent call last):
  File "/Users/yt/PyProjects/PyConnLindorm/demo.py", line 59, in <module>
    statement.execute(sql_offline_table)
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/cursor.py", line 224, in execute
    results = self._connection._client.prepare_and_execute(
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 461, in prepare_and_execute
    response_data = self._apply(request, 'ExecuteResponse')
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 227, in _apply
    parse_error_protobuf(response_body)
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 128, in parse_error_protobuf
    raise_sql_error(err.error_code, err.sql_state, err.error_message)
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 96, in raise_sql_error
    raise errors.InternalError(message, code, sqlstate)
phoenixdb.errors.InternalError: ('RuntimeException: java.sql.SQLException: java.sql.SQLException: offline table test_python not supported -> SQLException: java.sql.SQLException: offline table test_python not supported -> SQLException: offline table test_python not supported', 4294967295, '00000', None)
Exception ignored in: <function Connection.__del__ at 0x1036e9940>
Traceback (most recent call last):
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/connection.py", line 60, in __del__
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/connection.py", line 114, in close
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 397, in close_connection
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/phoenixdb/avatica/client.py", line 214, in _apply
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/google/protobuf/internal/python_message.py", line 1086, in SerializeToString
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/google/protobuf/internal/python_message.py", line 1095, in SerializePartialToString
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/google/protobuf/internal/python_message.py", line 1107, in InternalSerialize
  File "/Users/yt/Library/Python/3.8/lib/python/site-packages/google/protobuf/descriptor.py", line 166, in GetOptions
ImportError: sys.meta_path is None, Python is likely shutting down

also "offline table test_python not supported"?

when will support this two ^-^