From 5503b3ba18e15cf23a7ab369e818db096d296f3d Mon Sep 17 00:00:00 2001 From: HTHou Date: Tue, 24 Dec 2024 10:23:19 +0800 Subject: [PATCH] [Py-client] rename table concept --- .../client-py/iotdb/utils/NumpyTablet.py | 2 +- iotdb-client/client-py/iotdb/utils/Tablet.py | 6 +- .../client-py/table_model_session_example.py | 2 +- .../table_model_session_pool_example.py | 2 +- .../integration/test_relational_session.py | 2 +- .../integration/test_tablemodel_insert.py | 156 +++++++++--------- 6 files changed, 85 insertions(+), 85 deletions(-) diff --git a/iotdb-client/client-py/iotdb/utils/NumpyTablet.py b/iotdb-client/client-py/iotdb/utils/NumpyTablet.py index 4ce623c9db90..6e17018c3b37 100644 --- a/iotdb-client/client-py/iotdb/utils/NumpyTablet.py +++ b/iotdb-client/client-py/iotdb/utils/NumpyTablet.py @@ -91,7 +91,7 @@ def __init__( self.bitmaps = bitmaps if column_types is None: self.__column_types = ColumnType.n_copy( - ColumnType.MEASUREMENT, self.__column_number + ColumnType.FIELD, self.__column_number ) else: self.__column_types = column_types diff --git a/iotdb-client/client-py/iotdb/utils/Tablet.py b/iotdb-client/client-py/iotdb/utils/Tablet.py index fbae5fe22935..cf99d3f0c52c 100644 --- a/iotdb-client/client-py/iotdb/utils/Tablet.py +++ b/iotdb-client/client-py/iotdb/utils/Tablet.py @@ -27,8 +27,8 @@ @unique class ColumnType(IntEnum): - ID = 0 - MEASUREMENT = 1 + TAG = 0 + FIELD = 1 ATTRIBUTE = 2 def n_copy(self, n): @@ -88,7 +88,7 @@ def __init__( self.__column_number = len(column_names) if column_types is None: self.__column_types = ColumnType.n_copy( - ColumnType.MEASUREMENT, self.__column_number + ColumnType.FIELD, self.__column_number ) else: self.__column_types = column_types diff --git a/iotdb-client/client-py/table_model_session_example.py b/iotdb-client/client-py/table_model_session_example.py index 108373b55a37..4d2ef0730d3c 100644 --- a/iotdb-client/client-py/table_model_session_example.py +++ b/iotdb-client/client-py/table_model_session_example.py @@ -116,7 +116,7 @@ TSDataType.STRING, TSDataType.DOUBLE, ] -column_types = [ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT] +column_types = [ColumnType.TAG, ColumnType.ATTRIBUTE, ColumnType.FIELD] timestamps = [] values = [] for row in range(15): diff --git a/iotdb-client/client-py/table_model_session_pool_example.py b/iotdb-client/client-py/table_model_session_pool_example.py index 64aeec917c0c..156ba8a450df 100644 --- a/iotdb-client/client-py/table_model_session_pool_example.py +++ b/iotdb-client/client-py/table_model_session_pool_example.py @@ -65,7 +65,7 @@ def insert_data(num: int): TSDataType.STRING, TSDataType.DOUBLE, ] - column_types = [ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT] + column_types = [ColumnType.TAG, ColumnType.ATTRIBUTE, ColumnType.FIELD] timestamps = [] values = [] for row in range(15): diff --git a/iotdb-client/client-py/tests/integration/test_relational_session.py b/iotdb-client/client-py/tests/integration/test_relational_session.py index bcbb85c5b4f9..6ae39d0ab1b1 100644 --- a/iotdb-client/client-py/tests/integration/test_relational_session.py +++ b/iotdb-client/client-py/tests/integration/test_relational_session.py @@ -67,7 +67,7 @@ def session_test(use_session_pool=False): TSDataType.STRING, TSDataType.DOUBLE, ] - column_types = [ColumnType.ID, ColumnType.ATTRIBUTE, ColumnType.MEASUREMENT] + column_types = [ColumnType.TAG, ColumnType.ATTRIBUTE, ColumnType.FIELD] timestamps = [] values = [] for row in range(15): diff --git a/iotdb-client/client-py/tests/integration/test_tablemodel_insert.py b/iotdb-client/client-py/tests/integration/test_tablemodel_insert.py index 037a876a73eb..05885332f48b 100644 --- a/iotdb-client/client-py/tests/integration/test_tablemodel_insert.py +++ b/iotdb-client/client-py/tests/integration/test_tablemodel_insert.py @@ -95,22 +95,22 @@ def test_insert_use_tablet(): TSDataType.STRING, ] column_types = [ - ColumnType.ID, - ColumnType.ID, - ColumnType.ID, + ColumnType.TAG, + ColumnType.TAG, + ColumnType.TAG, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, ] timestamps = [] values = [] @@ -374,22 +374,22 @@ def test_insert_use_tablet(): TSDataType.STRING, ] column_types = [ - ColumnType.ID, - ColumnType.ID, - ColumnType.ID, + ColumnType.TAG, + ColumnType.TAG, + ColumnType.TAG, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, ] timestamps = [] values = [] @@ -687,22 +687,22 @@ def test_insert_relational_tablet_use_numpy_tablet(): TSDataType.STRING, ] column_types = [ - ColumnType.ID, - ColumnType.ID, - ColumnType.ID, + ColumnType.TAG, + ColumnType.TAG, + ColumnType.TAG, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, ] np_timestamps = np.arange(0, 10, dtype=np.dtype(">i8")) np_values = [ @@ -904,22 +904,22 @@ def test_insert_relational_tablet_use_numpy_tablet(): TSDataType.STRING, ] column_types = [ - ColumnType.ID, - ColumnType.ID, - ColumnType.ID, + ColumnType.TAG, + ColumnType.TAG, + ColumnType.TAG, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, ] np_timestamps = np.arange(0, 10, dtype=np.dtype(">i8")) np_values = [ @@ -1155,22 +1155,22 @@ def test_insert_relational_tablet_auto_create(): TSDataType.STRING, ] column_types = [ - ColumnType.ID, - ColumnType.ID, - ColumnType.ID, + ColumnType.TAG, + ColumnType.TAG, + ColumnType.TAG, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, ] timestamps = [] values = [] @@ -1423,22 +1423,22 @@ def test_insert_relational_tablet_auto_create(): TSDataType.STRING, ] column_types = [ - ColumnType.ID, - ColumnType.ID, - ColumnType.ID, + ColumnType.TAG, + ColumnType.TAG, + ColumnType.TAG, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, ColumnType.ATTRIBUTE, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, - ColumnType.MEASUREMENT, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, + ColumnType.FIELD, ] np_timestamps = np.arange(0, 10, dtype=np.dtype(">i8")) np_values = [