Commit eed57c4f authored by Lukáš Lalinský's avatar Lukáš Lalinský

Broken ARRAY test

parent 66db384c
......@@ -113,3 +113,5 @@ Known issues
but the remote protocol only exposes the time (hour/minute/second) or date (year/month/day)
parts of the columns. (`CALCITE-797 <https://issues.apache.org/jira/browse/CALCITE-797>`_, `CALCITE-798 <https://issues.apache.org/jira/browse/CALCITE-798>`_)
- TIMESTAMP columns in Phoenix are stored with a nanosecond accuracy, but the remote protocol truncates them to milliseconds. (`CALCITE-796 <https://issues.apache.org/jira/browse/CALCITE-796>`_)
- ARRAY columns are not supported.
(`CALCITE-1050 <https://issues.apache.org/jira/browse/CALCITE-1050>`_, `PHOENIX-2585 <https://issues.apache.org/jira/browse/PHOENIX-2585>`_)
......@@ -202,6 +202,8 @@ class Cursor(object):
self._parameter_data_types.append(('JAVA_SQL_TIMESTAMP', datetime_to_java_sql_timestamp))
elif parameter['className'] == '[B':
self._parameter_data_types.append(('BYTE_STRING', Binary))
#elif parameter['className'] == 'org.apache.phoenix.schema.types.PhoenixArray':
# self._parameter_data_types.append(('ARRAY', None))
else:
self._parameter_data_types.append(('OBJECT', None))
......
......@@ -293,3 +293,16 @@ class TypesTest(DatabaseTestCase):
cursor.execute("UPSERT INTO phoenixdb_test_tbl1 VALUES (1, ?)", [phoenixdb.Binary(value)])
cursor.execute("SELECT id, val FROM phoenixdb_test_tbl1 ORDER BY id")
self.assertEqual(cursor.fetchall(), [[1, value]])
@unittest.skip("https://issues.apache.org/jira/browse/CALCITE-1050 https://issues.apache.org/jira/browse/PHOENIX-2585")
def test_array(self):
self.createTable("phoenixdb_test_tbl1", "id integer primary key, val integer[]")
with self.conn.cursor() as cursor:
cursor.execute("UPSERT INTO phoenixdb_test_tbl1 VALUES (1, ARRAY[1,2])")
cursor.execute("UPSERT INTO phoenixdb_test_tbl1 VALUES (2, ?)", [[2,3]])
cursor.execute("SELECT id, val FROM phoenixdb_test_tbl1 ORDER BY id")
self.assertEqual(cursor.fetchall(), [
[1, [1,2]],
[2, [2,3]],
])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment