iginx-pyclient 0.7.1__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {iginx-pyclient-0.7.1/iginx_pyclient.egg-info → iginx-pyclient-0.8.0}/PKG-INFO +1 -1
  2. iginx-pyclient-0.8.0/iginx_pyclient/__init__.py +20 -0
  3. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient/cluster_info.py +10 -8
  4. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient/dataset.py +10 -8
  5. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient/session.py +28 -13
  6. iginx-pyclient-0.8.0/iginx_pyclient/thrift/__init__.py +20 -0
  7. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient/thrift/rpc/IService.py +415 -35
  8. iginx-pyclient-0.8.0/iginx_pyclient/thrift/rpc/__init__.py +21 -0
  9. iginx-pyclient-0.8.0/iginx_pyclient/thrift/rpc/constants.py +34 -0
  10. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient/thrift/rpc/ttypes.py +1551 -740
  11. iginx-pyclient-0.8.0/iginx_pyclient/time_series.py +39 -0
  12. iginx-pyclient-0.8.0/iginx_pyclient/utils/__init__.py +21 -0
  13. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient/utils/bitmap.py +10 -8
  14. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient/utils/byte_utils.py +10 -8
  15. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0/iginx_pyclient.egg-info}/PKG-INFO +1 -1
  16. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/setup.py +11 -9
  17. iginx-pyclient-0.7.1/iginx_pyclient/__init__.py +0 -19
  18. iginx-pyclient-0.7.1/iginx_pyclient/thrift/__init__.py +0 -18
  19. iginx-pyclient-0.7.1/iginx_pyclient/thrift/rpc/__init__.py +0 -19
  20. iginx-pyclient-0.7.1/iginx_pyclient/thrift/rpc/constants.py +0 -32
  21. iginx-pyclient-0.7.1/iginx_pyclient/time_series.py +0 -37
  22. iginx-pyclient-0.7.1/iginx_pyclient/utils/__init__.py +0 -19
  23. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/LICENSE +0 -0
  24. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/MANIFEST.in +0 -0
  25. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/README.md +0 -0
  26. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient.egg-info/SOURCES.txt +0 -0
  27. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient.egg-info/dependency_links.txt +0 -0
  28. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient.egg-info/requires.txt +0 -0
  29. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/iginx_pyclient.egg-info/top_level.txt +0 -0
  30. {iginx-pyclient-0.7.1 → iginx-pyclient-0.8.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: iginx-pyclient
3
- Version: 0.7.1
3
+ Version: 0.8.0
4
4
  Summary: IGinX-PyClient
5
5
  Author: THU IGinX
6
6
  Author-email: TSIginX@gmail.com
@@ -0,0 +1,20 @@
1
+ #
2
+ # IGinX - the polystore system with high performance
3
+ # Copyright (C) Tsinghua University
4
+ # TSIGinX@gmail.com
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU Lesser General Public
8
+ # License as published by the Free Software Foundation; either
9
+ # version 3 of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ # Lesser General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with this program; if not, write to the Free Software Foundation,
18
+ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ #
20
+
@@ -1,19 +1,21 @@
1
1
  #
2
2
  # IGinX - the polystore system with high performance
3
3
  # Copyright (C) Tsinghua University
4
+ # TSIGinX@gmail.com
4
5
  #
5
- # This program is free software: you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License as published by
7
- # the Free Software Foundation, either version 3 of the License, or
8
- # (at your option) any later version.
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU Lesser General Public
8
+ # License as published by the Free Software Foundation; either
9
+ # version 3 of the License, or (at your option) any later version.
9
10
  #
10
11
  # This program is distributed in the hope that it will be useful,
11
12
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU General Public License for more details.
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ # Lesser General Public License for more details.
14
15
  #
15
- # You should have received a copy of the GNU General Public License
16
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with this program; if not, write to the Free Software Foundation,
18
+ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
19
  #
18
20
 
19
21
  from .thrift.rpc.ttypes import StorageEngineType
@@ -1,19 +1,21 @@
1
1
  #
2
2
  # IGinX - the polystore system with high performance
3
3
  # Copyright (C) Tsinghua University
4
+ # TSIGinX@gmail.com
4
5
  #
5
- # This program is free software: you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License as published by
7
- # the Free Software Foundation, either version 3 of the License, or
8
- # (at your option) any later version.
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU Lesser General Public
8
+ # License as published by the Free Software Foundation; either
9
+ # version 3 of the License, or (at your option) any later version.
9
10
  #
10
11
  # This program is distributed in the hope that it will be useful,
11
12
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU General Public License for more details.
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ # Lesser General Public License for more details.
14
15
  #
15
- # You should have received a copy of the GNU General Public License
16
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with this program; if not, write to the Free Software Foundation,
18
+ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
19
  #
18
20
 
19
21
  from enum import Enum
@@ -1,24 +1,27 @@
1
1
  #
2
2
  # IGinX - the polystore system with high performance
3
3
  # Copyright (C) Tsinghua University
4
+ # TSIGinX@gmail.com
4
5
  #
5
- # This program is free software: you can redistribute it and/or modify
6
- # it under the terms of the GNU General Public License as published by
7
- # the Free Software Foundation, either version 3 of the License, or
8
- # (at your option) any later version.
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU Lesser General Public
8
+ # License as published by the Free Software Foundation; either
9
+ # version 3 of the License, or (at your option) any later version.
9
10
  #
10
11
  # This program is distributed in the hope that it will be useful,
11
12
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- # GNU General Public License for more details.
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ # Lesser General Public License for more details.
14
15
  #
15
- # You should have received a copy of the GNU General Public License
16
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with this program; if not, write to the Free Software Foundation,
18
+ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
19
  #
18
20
 
19
21
  import csv
20
22
  import logging
21
23
  import os.path
24
+ import time
22
25
  from datetime import datetime
23
26
 
24
27
  import pandas as pd
@@ -56,7 +59,7 @@ from .thrift.rpc.ttypes import (
56
59
  DebugInfoReq,
57
60
  LoadCSVReq,
58
61
 
59
- StorageEngine, DataType,
62
+ StorageEngine, DataType, FileChunk, UploadFileReq,
60
63
  )
61
64
  from .time_series import TimeSeries
62
65
  from .utils.bitmap import Bitmap
@@ -527,11 +530,23 @@ class Session(object):
527
530
  if not path.endswith(".csv"):
528
531
  raise ValueError(f"The file name must end with [.csv], {path} doesn't satisfy the requirement!")
529
532
 
533
+ chunk_size = 1024 * 1024
534
+ filename = str(time.time() * 1000) + ".csv"
530
535
  with open(file, 'rb') as f:
531
- bytes_content = f.read() # 读取文件内容为bytes
532
-
533
- csv_content = bytes_content
534
- req = LoadCSVReq(sessionId=self.__session_id, statement=statement, csvFile=csv_content)
536
+ offset = 0
537
+ while chunk := f.read(chunk_size):
538
+ chunk_data = FileChunk(
539
+ fileName=filename,
540
+ offset=offset,
541
+ data=chunk,
542
+ chunkSize=len(chunk)
543
+ )
544
+ req = UploadFileReq(sessionId=self.__session_id, fileChunk=chunk_data)
545
+ resp = self.__client.uploadFileChunk(req)
546
+ Session.verify_status(resp.status)
547
+ offset += len(chunk)
548
+
549
+ req = LoadCSVReq(sessionId=self.__session_id, statement=statement, csvFileName=filename)
535
550
  resp = self.__client.loadCSV(req)
536
551
  Session.verify_status(resp.status)
537
552
  return resp
@@ -0,0 +1,20 @@
1
+ #
2
+ # IGinX - the polystore system with high performance
3
+ # Copyright (C) Tsinghua University
4
+ # TSIGinX@gmail.com
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU Lesser General Public
8
+ # License as published by the Free Software Foundation; either
9
+ # version 3 of the License, or (at your option) any later version.
10
+ #
11
+ # This program is distributed in the hope that it will be useful,
12
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ # Lesser General Public License for more details.
15
+ #
16
+ # You should have received a copy of the GNU Lesser General Public License
17
+ # along with this program; if not, write to the Free Software Foundation,
18
+ # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
+ #
20
+