2023-02-24T02:17:17,401 Created temporary directory: /tmp/pip-ephem-wheel-cache-el9mtz2k 2023-02-24T02:17:17,406 Created temporary directory: /tmp/pip-build-tracker-86ik_8ez 2023-02-24T02:17:17,407 Initialized build tracking at /tmp/pip-build-tracker-86ik_8ez 2023-02-24T02:17:17,408 Created build tracker: /tmp/pip-build-tracker-86ik_8ez 2023-02-24T02:17:17,408 Entered build tracker: /tmp/pip-build-tracker-86ik_8ez 2023-02-24T02:17:17,409 Created temporary directory: /tmp/pip-wheel-zengubrd 2023-02-24T02:17:17,420 DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453 2023-02-24T02:17:17,425 Created temporary directory: /tmp/pip-ephem-wheel-cache-q1h8q0gn 2023-02-24T02:17:17,479 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2023-02-24T02:17:17,486 2 location(s) to search for versions of apache-iotdb: 2023-02-24T02:17:17,486 * https://pypi.org/simple/apache-iotdb/ 2023-02-24T02:17:17,486 * https://www.piwheels.org/simple/apache-iotdb/ 2023-02-24T02:17:17,487 Fetching project page and analyzing links: https://pypi.org/simple/apache-iotdb/ 2023-02-24T02:17:17,488 Getting page https://pypi.org/simple/apache-iotdb/ 2023-02-24T02:17:17,492 Found index url https://pypi.org/simple 2023-02-24T02:17:17,725 Fetched page https://pypi.org/simple/apache-iotdb/ as application/vnd.pypi.simple.v1+json 2023-02-24T02:17:17,754 Found link https://files.pythonhosted.org/packages/76/14/d01b6281df00530c69bc8eae2074b9970bbe865a5e971b5cd2019e8b8250/apache-iotdb-0.9.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.0 2023-02-24T02:17:17,755 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/84/aa/fa9401ccadb89ddce7c2b8a03baee9dbb9913c52b5936d0ec7968cabf056/apache_iotdb-0.9.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,757 Found link https://files.pythonhosted.org/packages/01/fa/e65db378e4d8e07322ec175f37568bceb55ebb3c8397fa7b48e9f087c451/apache-iotdb-0.9.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.2 2023-02-24T02:17:17,758 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/43/8d/72fa03325e9281b613a0eabae9cc7c606ce0e8952bee0c3ca855e4579a1d/apache_iotdb-0.9.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,759 Found link https://files.pythonhosted.org/packages/34/95/030c2da665358de8ba950099b3b0397dca437fcde60d5d1730d0c451d5e3/apache-iotdb-0.9.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.9.3 2023-02-24T02:17:17,760 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/5c/d4/2e329baab32ad93730ba4b79df9b91f1d55d0d37428a5dbbe2dd4c9f3a9d/apache_iotdb-0.9.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,761 Found link https://files.pythonhosted.org/packages/1d/dc/138e08717f8c2e0e238f35d39b34af6cfc1c7a1332b6aa4689750f4fda26/apache-iotdb-0.10.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.10.0 2023-02-24T02:17:17,762 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/c3/76/46884f04945b6f02bbec4e06d83fafc16f326ca0f9b35b8c0141018990c0/apache_iotdb-0.10.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,763 Found link https://files.pythonhosted.org/packages/f6/4d/b229b9f309431e8164c9cd893431009a57efcaa059f58c1091d222601da3/apache-iotdb-0.10.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.10.1 2023-02-24T02:17:17,764 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/d6/87/2e003dcf87ffa8e73f48a62a107b989967e906670d905a05ae1c1349f396/apache_iotdb-0.10.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,765 Found link https://files.pythonhosted.org/packages/16/8b/2ec65fa81d5961bd927c02d6a209490bf325b2a164506cd3b12e846d7061/apache-iotdb-0.11.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.0 2023-02-24T02:17:17,766 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/47/c8/047703f7e8125b15361c766b90c6f1cbdbf797f84803f38b1732c1a386cb/apache_iotdb-0.11.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,767 Found link https://files.pythonhosted.org/packages/55/a1/ef100f67e0f26fbc1d19b84115b21de942e7b7e01803706d19f841ac06c1/apache-iotdb-0.11.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.1 2023-02-24T02:17:17,768 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/9f/9f/dce2d782c8b64700539039ef5d66f5f7a781689538c0a176cf56099ec9d1/apache_iotdb-0.11.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,769 Found link https://files.pythonhosted.org/packages/69/d5/f1b9ff293fe02eb1f1cb3cba13b5d9a4b547415ab0045b2a8a3612249e12/apache-iotdb-0.11.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.2 2023-02-24T02:17:17,770 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/2b/96/a5f0c63659cc8477c53d8a8321c07ea5a0bb2430abaaab477a6185bb43a1/apache_iotdb-0.11.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,771 Found link https://files.pythonhosted.org/packages/7d/cf/0d672a828527f59cdc66c078b0b8e356ca0a3191224a4363ce2256337d1c/apache-iotdb-0.11.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.3 2023-02-24T02:17:17,772 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/d2/c7/6709b26341e59788d05a297182aa3f96c692e85421c169f657e92c3b4765/apache_iotdb-0.11.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,773 Found link https://files.pythonhosted.org/packages/00/a1/5b1b8a2754f4b25420d9a4461b5e2b8573bb89b43054f9303ea0558df0de/apache-iotdb-0.11.4.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.11.4 2023-02-24T02:17:17,774 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/48/f4/a21fd4495f93c428de788a477665f1815b257568469c38108666125fff4b/apache_iotdb-0.11.4-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,775 Found link https://files.pythonhosted.org/packages/9e/16/bb2ef45f62e9866f1be97f04e2c581247d3b145e5d8a01b7c143023c6c45/apache-iotdb-0.12.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.0 2023-02-24T02:17:17,776 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/93/32/e051c3ce387e54b1f036995e92ff352895cf01a51b170752e906a7d42364/apache_iotdb-0.12.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,777 Found link https://files.pythonhosted.org/packages/20/0c/b39e9f362fb0a1a43cb0a05a5b2d9163815f0048575e0c071bbaa50070b8/apache-iotdb-0.12.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.1 2023-02-24T02:17:17,778 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/55/cf/219a0c3cd17537cebf6e67deeaa77b57741c9b40bcddbb7f59ac9b828401/apache_iotdb-0.12.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,780 Found link https://files.pythonhosted.org/packages/fd/64/d83ceaaab941dd78df38cd8c35d27028a27724c2535f0e6f01a48472aa28/apache-iotdb-0.12.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.2 2023-02-24T02:17:17,780 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/0b/33/60af46cbc25d7ecf9722bf311295cb0acbf2841f6eb3e3af7433ac3e199d/apache_iotdb-0.12.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,782 Found link https://files.pythonhosted.org/packages/24/7c/81a9dcfd218d4654b03d9079578659d6201aa4f9e9ccba328c0742e8e9c1/apache-iotdb-0.12.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.3 2023-02-24T02:17:17,782 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/9f/ae/e79cef98fa20cf977ea22b065fcff8d7b976922dd281f4a74a02b1a72b41/apache_iotdb-0.12.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,784 Found link https://files.pythonhosted.org/packages/9e/11/0d12f9b906b3aac1446c09e297bcdf3a0cdfb016aae1ec77effa214999de/apache-iotdb-0.12.4.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.4 2023-02-24T02:17:17,784 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/2b/cb/34f5d9137086d912e4518d751eca1ac9a8b908706c4b3176ca32911fabd2/apache_iotdb-0.12.4-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,786 Found link https://files.pythonhosted.org/packages/8a/52/93503eac47c1561edc21431f7154b694afad9d461e2af0fea36966953c24/apache-iotdb-0.12.5.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.5 2023-02-24T02:17:17,786 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/7a/30/1cd9bca76c1f4f9b4cd48d11f23103ade9c5a35410bbf0a8f5997bab51b0/apache_iotdb-0.12.5-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,788 Found link https://files.pythonhosted.org/packages/00/d9/19746ff8906cc2ac3c9326fbcbd244d2424f4aad5d7201843956d27dcb0b/apache-iotdb-0.12.6.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.12.6 2023-02-24T02:17:17,788 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/cf/7b/ab3acb96fd057e900f9aca1b030f4fb42caf4104000ab742ce19a1029b6f/apache_iotdb-0.12.6-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,790 Found link https://files.pythonhosted.org/packages/a6/cd/33de301e51132f8d0d79adc346d38685a6b871251846bad95b35ebf74ac9/apache-iotdb-0.13.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.0 2023-02-24T02:17:17,790 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/71/c1/3684d3b6e6eddda5fbe994e123c6bc6569409994a44b5d3e4b130554802a/apache_iotdb-0.13.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,792 Found link https://files.pythonhosted.org/packages/7e/3e/40f0d900e04598036cc65ae437a2ee9f4aa149860d434a6f4b291460582c/apache-iotdb-0.13.0.post1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.0.post1 2023-02-24T02:17:17,792 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/7c/f2/ef6f589910f1b850ad665d4958e2a26b5249bddc81d5f29a711e21a79dc1/apache_iotdb-0.13.0.post1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,794 Found link https://files.pythonhosted.org/packages/e5/47/3efce218f936953f6ee5e338748981137a5d30579578038a67063b1c10d8/apache-iotdb-0.13.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.1 2023-02-24T02:17:17,794 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/b7/1d/3074d8ab58366c99783fe0ed853472a21d69dfd2b80ca001281d170833e2/apache_iotdb-0.13.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,796 Found link https://files.pythonhosted.org/packages/6f/55/1bcfde81cb204d77387e7cadbf8c3510ec04a2b02fa8b26d04b8f5037bca/apache-iotdb-0.13.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.2 2023-02-24T02:17:17,797 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/94/0c/3a7d8a238d7c8771453889f8f03f9ebcd418839306e64f4ddea8c0baee81/apache_iotdb-0.13.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,798 Found link https://files.pythonhosted.org/packages/30/a0/0153c56e1af8653bfdcf47423949dd6b23e53882c9009acc25e661a44dbe/apache-iotdb-0.13.3.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.3 2023-02-24T02:17:17,799 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/a0/51/7e8405405f7f0ef8eabab31b4860cb747a8acfa53e30f56939c115b53db9/apache_iotdb-0.13.3-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,800 Found link https://files.pythonhosted.org/packages/bb/7d/24cefdcd57e96d496fd3492fc28b3d53da6ba0fc6ee69f99dddec1cf500c/apache-iotdb-0.14.0rc1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.14.0rc1 2023-02-24T02:17:17,801 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/6d/37/0e5a292ed1a695927cefec20d4ad01d3c7af78e691d5250f1646f318d4ef/apache_iotdb-0.14.0rc1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,802 Found link https://files.pythonhosted.org/packages/49/91/11702001bdc0af0266d5f4dd222b5f937684e8c08e5044735ade6748cd58/apache-iotdb-1.0.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.0.0 2023-02-24T02:17:17,803 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/3d/57/3019d5cf51e6198d5b7ee9e3c07a15efa7487e8b280b4b71cc521a6651e3/apache_iotdb-1.0.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,804 Found link https://files.pythonhosted.org/packages/0b/d7/475e11d05f2d4bc65f9b7d14691158489fbb7726a26cee5a016e94e6640a/apache-iotdb-1.0.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.0.1 2023-02-24T02:17:17,805 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/06/82/b658ff03f52072e1afde6bb9f1f1933427ef776a78e246965943fba552d8/apache_iotdb-1.0.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:17,805 Fetching project page and analyzing links: https://www.piwheels.org/simple/apache-iotdb/ 2023-02-24T02:17:17,806 Getting page https://www.piwheels.org/simple/apache-iotdb/ 2023-02-24T02:17:17,808 Found index url https://www.piwheels.org/simple 2023-02-24T02:17:18,018 Fetched page https://www.piwheels.org/simple/apache-iotdb/ as text/html 2023-02-24T02:17:18,038 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.0.0-py3-none-any.whl#sha256=85d0bb3ddb1c79359fec18e85c6d515dc3639752d77dea32c09c8afe0fefc906 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,039 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.14.0rc1-py3-none-any.whl#sha256=2f71e6b3443c4748717889729380082daa7bd8f9950d4c17909134372367bccc (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,039 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.3-py3-none-any.whl#sha256=c3be87cabc4d19ad9fd999f524ac8547b971adb4a304bf8874fdb56a6ecca371 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,040 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.2-py3-none-any.whl#sha256=136811be5cdfe045bc349a8f6c0b07117600185c0c7ada8353610179adde27ae (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,040 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.1-py3-none-any.whl#sha256=22668867268f1ea89b8205cbda30d0578aaa5ccfff0b552396e7059a95d3781a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,041 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.0.post1-py3-none-any.whl#sha256=d53cf02df2cc507d9caf48167c52d69e24abab9800430de3ff8abf8159bff63b (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,041 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.0-py3-none-any.whl#sha256=67b7429e60cdd5e1e3a808592a87a591c028af62de8e2fec2535b4a3105f21b7 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,042 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.6-py3-none-any.whl#sha256=a4f679df0053b74f83de861277de12e030eb8601063b172ec44789118ba11400 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,043 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.5-py3-none-any.whl#sha256=06bb080be5b0469037e68db56a7feb10da911a396a47d598598d8d8c50d07419 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,043 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.4-py3-none-any.whl#sha256=af5fa8000dd449fb6d98420287b2049b5e68d268fa1529fa96955b5fe7637c13 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,044 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.3-py3-none-any.whl#sha256=eb77b047b61a087b286e01afea6ee9761c9e687479a4e551be085d82612ed220 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,044 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.2-py3-none-any.whl#sha256=bb7605db211272947ba451cdad35a2b4f554167361f0c08acedbfb0723ac7ab8 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,045 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.1-py3-none-any.whl#sha256=bc5ddc6b683bf26a0b9a8c47ada13d29918503664e9e1c3fdefae73121f3a327 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,045 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.12.0-py3-none-any.whl#sha256=061d9407266b9d100113fa2d11890a8d5d56f8b496305c5864f08a9af35fcc12 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,046 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.4-py3-none-any.whl#sha256=cf1ee85db62d31642b32742aba0a026a941b85cf4bb49ec48ef09b9e241f3bf5 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,046 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.3-py3-none-any.whl#sha256=55e9a0042694ba7fa482f733a1d548c0180bccf0e35e090b85d7b9050c95162b (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,047 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.2-py3-none-any.whl#sha256=762d5b0c5f82869237d5375d2a8774f99654c3b693d6f77bf6e9decc78b7fd5d (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,047 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.1-py3-none-any.whl#sha256=317a24e4870d587820f8d5be294e2e9a6ad09f70566ce4380506085c47b2fc0a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,048 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.11.0-py3-none-any.whl#sha256=4771e87dd8d933815206c063014beff8eff4c8025353723ac67603f49a119224 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,048 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.10.1-py3-none-any.whl#sha256=b4b13fa0d6ed86fbcc1231cad3d220ee81b38452e87fea655641720f803d4c1d (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,049 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.10.0-py3-none-any.whl#sha256=388ade65f63cb37eef343e4f294cf3488b79894ff8061a7d9b2bf42277ded9de (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,049 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.3-py3-none-any.whl#sha256=b535b53a5182dc94116e67edb4a34c1efb007574273e2ff4ad72ebc3b4634326 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,050 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.2-py3-none-any.whl#sha256=b7fad95c7f041f18a621439aa3cd19fc79d76caa85a93967163566c10b7c6348 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,050 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.9.0-py3-none-any.whl#sha256=1feb6b731a9af26aac7a1e6fab74e85dd960562a1dca6e4c5c9d10234a570e82 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2023-02-24T02:17:18,051 Skipping link: not a file: https://www.piwheels.org/simple/apache-iotdb/ 2023-02-24T02:17:18,052 Skipping link: not a file: https://pypi.org/simple/apache-iotdb/ 2023-02-24T02:17:18,091 Given no hashes to check 1 links for project 'apache-iotdb': discarding no candidates 2023-02-24T02:17:18,119 Collecting apache-iotdb==1.0.1 2023-02-24T02:17:18,123 Created temporary directory: /tmp/pip-unpack-xjvo84zn 2023-02-24T02:17:18,353 Downloading apache-iotdb-1.0.1.tar.gz (82 kB) 2023-02-24T02:17:18,783 Added apache-iotdb==1.0.1 from https://files.pythonhosted.org/packages/0b/d7/475e11d05f2d4bc65f9b7d14691158489fbb7726a26cee5a016e94e6640a/apache-iotdb-1.0.1.tar.gz to build tracker '/tmp/pip-build-tracker-86ik_8ez' 2023-02-24T02:17:18,792 Created temporary directory: /tmp/pip-build-env-d0tm1w99 2023-02-24T02:17:18,812 Installing build dependencies: started 2023-02-24T02:17:18,815 Running command pip subprocess to install build dependencies 2023-02-24T02:17:21,531 Using pip 23.0.1 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7) 2023-02-24T02:17:22,718 DEPRECATION: --no-binary currently disables reading from the cache of locally built wheels. In the future --no-binary will not influence the wheel cache. pip 23.1 will enforce this behaviour change. A possible replacement is to use the --no-cache-dir option. You can use the flag --use-feature=no-binary-enable-wheel-cache to test the upcoming behaviour. Discussion can be found at https://github.com/pypa/pip/issues/11453 2023-02-24T02:17:22,779 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2023-02-24T02:17:26,719 Collecting setuptools>=40.8.0 2023-02-24T02:17:26,970 Using cached https://www.piwheels.org/simple/setuptools/setuptools-67.4.0-py3-none-any.whl (1.1 MB) 2023-02-24T02:17:27,599 Collecting wheel 2023-02-24T02:17:27,634 Using cached https://www.piwheels.org/simple/wheel/wheel-0.38.4-py3-none-any.whl (36 kB) 2023-02-24T02:17:32,266 Installing collected packages: wheel, setuptools 2023-02-24T02:17:32,543 Creating /tmp/pip-build-env-d0tm1w99/overlay/bin 2023-02-24T02:17:32,548 changing mode of /tmp/pip-build-env-d0tm1w99/overlay/bin/wheel to 755 2023-02-24T02:17:36,775 Successfully installed setuptools-67.4.0 wheel-0.38.4 2023-02-24T02:17:37,709 Installing build dependencies: finished with status 'done' 2023-02-24T02:17:37,720 Getting requirements to build wheel: started 2023-02-24T02:17:37,722 Running command Getting requirements to build wheel 2023-02-24T02:17:38,857 2023-02-24T02:17:38,864 # Apache IoTDB 2023-02-24T02:17:38,865 [![Python Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml) 2023-02-24T02:17:38,865 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2023-02-24T02:17:38,866 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2023-02-24T02:17:38,866 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2023-02-24T02:17:38,867 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2023-02-24T02:17:38,867 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2023-02-24T02:17:38,867 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2023-02-24T02:17:38,868 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2023-02-24T02:17:38,869 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2023-02-24T02:17:38,869 architecture, high performance and rich feature set together with its deep integration with 2023-02-24T02:17:38,869 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2023-02-24T02:17:38,869 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2023-02-24T02:17:38,870 ## Python Native API 2023-02-24T02:17:38,871 ### Requirements 2023-02-24T02:17:38,871 You have to install thrift (>=0.13) before using the package. 2023-02-24T02:17:38,873 ### How to use (Example) 2023-02-24T02:17:38,873 First, download the latest package: `pip3 install apache-iotdb` 2023-02-24T02:17:38,874 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2023-02-24T02:17:38,875 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2023-02-24T02:17:38,875 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2023-02-24T02:17:38,876 (you need to add `import iotdb` in the head of the file) 2023-02-24T02:17:38,877 Or: 2023-02-24T02:17:38,877 ```python 2023-02-24T02:17:38,878 from iotdb.Session import Session 2023-02-24T02:17:38,878 ip = "127.0.0.1" 2023-02-24T02:17:38,879 port_ = "6667" 2023-02-24T02:17:38,879 username_ = "root" 2023-02-24T02:17:38,879 password_ = "root" 2023-02-24T02:17:38,879 session = Session(ip, port_, username_, password_) 2023-02-24T02:17:38,880 session.open(False) 2023-02-24T02:17:38,880 zone = session.get_time_zone() 2023-02-24T02:17:38,880 session.close() 2023-02-24T02:17:38,881 ``` 2023-02-24T02:17:38,881 ### Initialization 2023-02-24T02:17:38,882 * Initialize a Session 2023-02-24T02:17:38,883 ```python 2023-02-24T02:17:38,883 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2023-02-24T02:17:38,883 ``` 2023-02-24T02:17:38,884 * Open a session, with a parameter to specify whether to enable RPC compression 2023-02-24T02:17:38,885 ```python 2023-02-24T02:17:38,885 session.open(enable_rpc_compression=False) 2023-02-24T02:17:38,885 ``` 2023-02-24T02:17:38,886 Notice: this RPC compression status of client must comply with that of IoTDB server 2023-02-24T02:17:38,887 * Close a Session 2023-02-24T02:17:38,887 ```python 2023-02-24T02:17:38,888 session.close() 2023-02-24T02:17:38,888 ``` 2023-02-24T02:17:38,889 ### Data Definition Interface (DDL Interface) 2023-02-24T02:17:38,889 #### DATABASE Management 2023-02-24T02:17:38,890 * CREATE DATABASE 2023-02-24T02:17:38,891 ```python 2023-02-24T02:17:38,891 session.set_storage_group(group_name) 2023-02-24T02:17:38,891 ``` 2023-02-24T02:17:38,892 * Delete one or several databases 2023-02-24T02:17:38,893 ```python 2023-02-24T02:17:38,893 session.delete_storage_group(group_name) 2023-02-24T02:17:38,893 session.delete_storage_groups(group_name_lst) 2023-02-24T02:17:38,894 ``` 2023-02-24T02:17:38,894 #### Timeseries Management 2023-02-24T02:17:38,895 * Create one or multiple timeseries 2023-02-24T02:17:38,895 ```python 2023-02-24T02:17:38,896 session.create_time_series(ts_path, data_type, encoding, compressor, 2023-02-24T02:17:38,896 props=None, tags=None, attributes=None, alias=None) 2023-02-24T02:17:38,897 session.create_multi_time_series( 2023-02-24T02:17:38,897 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2023-02-24T02:17:38,897 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2023-02-24T02:17:38,898 ) 2023-02-24T02:17:38,898 ``` 2023-02-24T02:17:38,899 * Create aligned timeseries 2023-02-24T02:17:38,899 ```python 2023-02-24T02:17:38,900 session.create_aligned_time_series( 2023-02-24T02:17:38,900 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2023-02-24T02:17:38,900 ) 2023-02-24T02:17:38,901 ``` 2023-02-24T02:17:38,901 Attention: Alias of measurements are **not supported** currently. 2023-02-24T02:17:38,902 * Delete one or several timeseries 2023-02-24T02:17:38,903 ```python 2023-02-24T02:17:38,903 session.delete_time_series(paths_list) 2023-02-24T02:17:38,903 ``` 2023-02-24T02:17:38,904 * Check whether the specific timeseries exists 2023-02-24T02:17:38,904 ```python 2023-02-24T02:17:38,905 session.check_time_series_exists(path) 2023-02-24T02:17:38,905 ``` 2023-02-24T02:17:38,906 ### Data Manipulation Interface (DML Interface) 2023-02-24T02:17:38,906 #### Insert 2023-02-24T02:17:38,907 It is recommended to use insertTablet to help improve write efficiency. 2023-02-24T02:17:38,908 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2023-02-24T02:17:38,908 * **Better Write Performance** 2023-02-24T02:17:38,908 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2023-02-24T02:17:38,909 We have two implementations of Tablet in Python API. 2023-02-24T02:17:38,910 * Normal Tablet 2023-02-24T02:17:38,910 ```python 2023-02-24T02:17:38,911 values_ = [ 2023-02-24T02:17:38,911 [False, 10, 11, 1.1, 10011.1, "test01"], 2023-02-24T02:17:38,911 [True, 100, 11111, 1.25, 101.0, "test02"], 2023-02-24T02:17:38,912 [False, 100, 1, 188.1, 688.25, "test03"], 2023-02-24T02:17:38,912 [True, 0, 0, 0, 6.25, "test04"], 2023-02-24T02:17:38,912 ] 2023-02-24T02:17:38,913 timestamps_ = [1, 2, 3, 4] 2023-02-24T02:17:38,913 tablet_ = Tablet( 2023-02-24T02:17:38,913 device_id, measurements_, data_types_, values_, timestamps_ 2023-02-24T02:17:38,914 ) 2023-02-24T02:17:38,914 session.insert_tablet(tablet_) 2023-02-24T02:17:38,914 ``` 2023-02-24T02:17:38,914 * Numpy Tablet 2023-02-24T02:17:38,915 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2023-02-24T02:17:38,915 With less memory footprint and time cost of serialization, the insert performance will be better. 2023-02-24T02:17:38,916 **Notice** 2023-02-24T02:17:38,917 1. time and value columns in Tablet are ndarray. 2023-02-24T02:17:38,917 2. recommended to use the specific dtypes to each ndarray, see the example below 2023-02-24T02:17:38,917 (if not, the default dtypes are also ok). 2023-02-24T02:17:38,918 ```python 2023-02-24T02:17:38,918 import numpy as np 2023-02-24T02:17:38,918 data_types_ = [ 2023-02-24T02:17:38,919 TSDataType.BOOLEAN, 2023-02-24T02:17:38,919 TSDataType.INT32, 2023-02-24T02:17:38,919 TSDataType.INT64, 2023-02-24T02:17:38,919 TSDataType.FLOAT, 2023-02-24T02:17:38,920 TSDataType.DOUBLE, 2023-02-24T02:17:38,920 TSDataType.TEXT, 2023-02-24T02:17:38,920 ] 2023-02-24T02:17:38,921 np_values_ = [ 2023-02-24T02:17:38,921 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-02-24T02:17:38,921 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-02-24T02:17:38,922 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-02-24T02:17:38,922 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-02-24T02:17:38,922 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-02-24T02:17:38,923 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-02-24T02:17:38,923 ] 2023-02-24T02:17:38,923 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2023-02-24T02:17:38,923 np_tablet_ = NumpyTablet( 2023-02-24T02:17:38,924 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2023-02-24T02:17:38,924 ) 2023-02-24T02:17:38,924 session.insert_tablet(np_tablet_) 2023-02-24T02:17:38,925 ``` 2023-02-24T02:17:38,925 * Insert multiple Tablets 2023-02-24T02:17:38,926 ```python 2023-02-24T02:17:38,926 session.insert_tablets(tablet_lst) 2023-02-24T02:17:38,927 ``` 2023-02-24T02:17:38,927 * Insert a Record 2023-02-24T02:17:38,928 ```python 2023-02-24T02:17:38,928 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2023-02-24T02:17:38,928 ``` 2023-02-24T02:17:38,929 * Insert multiple Records 2023-02-24T02:17:38,930 ```python 2023-02-24T02:17:38,930 session.insert_records( 2023-02-24T02:17:38,930 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2023-02-24T02:17:38,931 ) 2023-02-24T02:17:38,931 ``` 2023-02-24T02:17:38,932 * Insert multiple Records that belong to the same device. 2023-02-24T02:17:38,932 With type info the server has no need to do type inference, which leads a better performance 2023-02-24T02:17:38,933 ```python 2023-02-24T02:17:38,933 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2023-02-24T02:17:38,933 ``` 2023-02-24T02:17:38,934 #### Insert with type inference 2023-02-24T02:17:38,935 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2023-02-24T02:17:38,935 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2023-02-24T02:17:38,936 ```python 2023-02-24T02:17:38,936 session.insert_str_record(device_id, timestamp, measurements, string_values) 2023-02-24T02:17:38,937 ``` 2023-02-24T02:17:38,937 #### Insert of Aligned Timeseries 2023-02-24T02:17:38,938 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2023-02-24T02:17:38,939 * insert_aligned_record 2023-02-24T02:17:38,939 * insert_aligned_records 2023-02-24T02:17:38,939 * insert_aligned_records_of_one_device 2023-02-24T02:17:38,940 * insert_aligned_tablet 2023-02-24T02:17:38,940 * insert_aligned_tablets 2023-02-24T02:17:38,941 ### IoTDB-SQL Interface 2023-02-24T02:17:38,941 * Execute query statement 2023-02-24T02:17:38,942 ```python 2023-02-24T02:17:38,943 session.execute_query_statement(sql) 2023-02-24T02:17:38,943 ``` 2023-02-24T02:17:38,944 * Execute non query statement 2023-02-24T02:17:38,944 ```python 2023-02-24T02:17:38,945 session.execute_non_query_statement(sql) 2023-02-24T02:17:38,945 ``` 2023-02-24T02:17:38,945 * Execute statement 2023-02-24T02:17:38,946 ```python 2023-02-24T02:17:38,946 session.execute_statement(sql) 2023-02-24T02:17:38,947 ``` 2023-02-24T02:17:38,947 ### Schema Template 2023-02-24T02:17:38,948 #### Create Schema Template 2023-02-24T02:17:38,948 The step for creating a metadata template is as follows 2023-02-24T02:17:38,948 1. Create the template class 2023-02-24T02:17:38,949 2. Adding child Node,InternalNode and MeasurementNode can be chose 2023-02-24T02:17:38,949 3. Execute create schema template function 2023-02-24T02:17:38,950 ```python 2023-02-24T02:17:38,950 template = Template(name=template_name, share_time=True) 2023-02-24T02:17:38,951 i_node_gps = InternalNode(name="GPS", share_time=False) 2023-02-24T02:17:38,951 i_node_v = InternalNode(name="vehicle", share_time=True) 2023-02-24T02:17:38,951 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2023-02-24T02:17:38,952 i_node_gps.add_child(m_node_x) 2023-02-24T02:17:38,952 i_node_v.add_child(m_node_x) 2023-02-24T02:17:38,953 template.add_template(i_node_gps) 2023-02-24T02:17:38,953 template.add_template(i_node_v) 2023-02-24T02:17:38,953 template.add_template(m_node_x) 2023-02-24T02:17:38,954 session.create_schema_template(template) 2023-02-24T02:17:38,954 ``` 2023-02-24T02:17:38,954 #### Modify Schema Template nodes 2023-02-24T02:17:38,955 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2023-02-24T02:17:38,955 * add node in template 2023-02-24T02:17:38,955 ```python 2023-02-24T02:17:38,956 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2023-02-24T02:17:38,956 ``` 2023-02-24T02:17:38,957 * delete node in template 2023-02-24T02:17:38,957 ```python 2023-02-24T02:17:38,957 session.delete_node_in_template(template_name, path) 2023-02-24T02:17:38,958 ``` 2023-02-24T02:17:38,958 #### Set Schema Template 2023-02-24T02:17:38,959 ```python 2023-02-24T02:17:38,959 session.set_schema_template(template_name, prefix_path) 2023-02-24T02:17:38,959 ``` 2023-02-24T02:17:38,960 #### Uset Schema Template 2023-02-24T02:17:38,960 ```python 2023-02-24T02:17:38,961 session.unset_schema_template(template_name, prefix_path) 2023-02-24T02:17:38,961 ``` 2023-02-24T02:17:38,961 #### Show Schema Template 2023-02-24T02:17:38,962 * Show all schema templates 2023-02-24T02:17:38,962 ```python 2023-02-24T02:17:38,962 session.show_all_templates() 2023-02-24T02:17:38,963 ``` 2023-02-24T02:17:38,963 * Count all nodes in templates 2023-02-24T02:17:38,963 ```python 2023-02-24T02:17:38,964 session.count_measurements_in_template(template_name) 2023-02-24T02:17:38,964 ``` 2023-02-24T02:17:38,964 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2023-02-24T02:17:38,965 ```python 2023-02-24T02:17:38,965 session.count_measurements_in_template(template_name, path) 2023-02-24T02:17:38,966 ``` 2023-02-24T02:17:38,967 * Judge whether the path is exist or not in templates, This path may not belong to the template 2023-02-24T02:17:38,967 ```python 2023-02-24T02:17:38,967 session.is_path_exist_in_template(template_name, path) 2023-02-24T02:17:38,968 ``` 2023-02-24T02:17:38,969 * Show nodes under in schema template 2023-02-24T02:17:38,969 ```python 2023-02-24T02:17:38,969 session.show_measurements_in_template(template_name) 2023-02-24T02:17:38,970 ``` 2023-02-24T02:17:38,970 * Show the path prefix where a schema template is set 2023-02-24T02:17:38,971 ```python 2023-02-24T02:17:38,971 session.show_paths_template_set_on(template_name) 2023-02-24T02:17:38,971 ``` 2023-02-24T02:17:38,972 * Show the path prefix where a schema template is used (i.e. the time series has been created) 2023-02-24T02:17:38,972 ```python 2023-02-24T02:17:38,972 session.show_paths_template_using_on(template_name) 2023-02-24T02:17:38,973 ``` 2023-02-24T02:17:38,973 #### Drop Schema Template 2023-02-24T02:17:38,974 Delete an existing metadata template,dropping an already set template is not supported 2023-02-24T02:17:38,974 ```python 2023-02-24T02:17:38,974 session.drop_schema_template("template_python") 2023-02-24T02:17:38,975 ``` 2023-02-24T02:17:38,975 ### Pandas Support 2023-02-24T02:17:38,976 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2023-02-24T02:17:38,976 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2023-02-24T02:17:38,977 Example: 2023-02-24T02:17:38,978 ```python 2023-02-24T02:17:38,978 from iotdb.Session import Session 2023-02-24T02:17:38,979 ip = "127.0.0.1" 2023-02-24T02:17:38,979 port_ = "6667" 2023-02-24T02:17:38,979 username_ = "root" 2023-02-24T02:17:38,979 password_ = "root" 2023-02-24T02:17:38,980 session = Session(ip, port_, username_, password_) 2023-02-24T02:17:38,980 session.open(False) 2023-02-24T02:17:38,980 result = session.execute_query_statement("SELECT * FROM root.*") 2023-02-24T02:17:38,981 # Transform to Pandas Dataset 2023-02-24T02:17:38,981 df = result.todf() 2023-02-24T02:17:38,982 session.close() 2023-02-24T02:17:38,982 # Now you can work with the dataframe 2023-02-24T02:17:38,983 df = ... 2023-02-24T02:17:38,983 ``` 2023-02-24T02:17:38,984 ### IoTDB Testcontainer 2023-02-24T02:17:38,984 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2023-02-24T02:17:38,985 To start (and stop) an IoTDB Database in a Docker container simply do: 2023-02-24T02:17:38,985 ```python 2023-02-24T02:17:38,986 class MyTestCase(unittest.TestCase): 2023-02-24T02:17:38,986 def test_something(self): 2023-02-24T02:17:38,987 with IoTDBContainer() as c: 2023-02-24T02:17:38,987 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2023-02-24T02:17:38,987 session.open(False) 2023-02-24T02:17:38,988 result = session.execute_query_statement("SHOW TIMESERIES") 2023-02-24T02:17:38,988 print(result) 2023-02-24T02:17:38,988 session.close() 2023-02-24T02:17:38,989 ``` 2023-02-24T02:17:38,989 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2023-02-24T02:17:38,990 ### IoTDB DBAPI 2023-02-24T02:17:38,991 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2023-02-24T02:17:38,991 interface for accessing databases in Python. 2023-02-24T02:17:38,992 #### Examples 2023-02-24T02:17:38,992 + Initialization 2023-02-24T02:17:38,992 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2023-02-24T02:17:38,993 ```python 2023-02-24T02:17:38,993 from iotdb.dbapi import connect 2023-02-24T02:17:38,994 ip = "127.0.0.1" 2023-02-24T02:17:38,994 port_ = "6667" 2023-02-24T02:17:38,995 username_ = "root" 2023-02-24T02:17:38,995 password_ = "root" 2023-02-24T02:17:38,995 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2023-02-24T02:17:38,995 cursor = conn.cursor() 2023-02-24T02:17:38,996 ``` 2023-02-24T02:17:38,996 + simple SQL statement execution 2023-02-24T02:17:38,997 ```python 2023-02-24T02:17:38,997 cursor.execute("SELECT * FROM root.*") 2023-02-24T02:17:38,997 for row in cursor.fetchall(): 2023-02-24T02:17:38,997 print(row) 2023-02-24T02:17:38,998 ``` 2023-02-24T02:17:38,998 + execute SQL with parameter 2023-02-24T02:17:38,999 IoTDB DBAPI supports pyformat style parameters 2023-02-24T02:17:38,999 ```python 2023-02-24T02:17:39,000 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2023-02-24T02:17:39,000 for row in cursor.fetchall(): 2023-02-24T02:17:39,000 print(row) 2023-02-24T02:17:39,001 ``` 2023-02-24T02:17:39,001 + execute SQL with parameter sequences 2023-02-24T02:17:39,001 ```python 2023-02-24T02:17:39,002 seq_of_parameters = [ 2023-02-24T02:17:39,002 {"timestamp": 1, "temperature": 1}, 2023-02-24T02:17:39,002 {"timestamp": 2, "temperature": 2}, 2023-02-24T02:17:39,003 {"timestamp": 3, "temperature": 3}, 2023-02-24T02:17:39,003 {"timestamp": 4, "temperature": 4}, 2023-02-24T02:17:39,003 {"timestamp": 5, "temperature": 5}, 2023-02-24T02:17:39,004 ] 2023-02-24T02:17:39,004 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2023-02-24T02:17:39,004 cursor.executemany(sql,seq_of_parameters) 2023-02-24T02:17:39,004 ``` 2023-02-24T02:17:39,005 + close the connection and cursor 2023-02-24T02:17:39,005 ```python 2023-02-24T02:17:39,006 cursor.close() 2023-02-24T02:17:39,006 conn.close() 2023-02-24T02:17:39,006 ``` 2023-02-24T02:17:39,007 ### IoTDB SQLAlchemy Dialect (Experimental) 2023-02-24T02:17:39,007 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2023-02-24T02:17:39,008 This part is still being improved. 2023-02-24T02:17:39,008 Please do not use it in the production environment! 2023-02-24T02:17:39,008 #### Mapping of the metadata 2023-02-24T02:17:39,008 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2023-02-24T02:17:39,009 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2023-02-24T02:17:39,009 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2023-02-24T02:17:39,009 Converting the data model of IoTDB into the data model of SQLAlchemy. 2023-02-24T02:17:39,010 The metadata in the IoTDB are: 2023-02-24T02:17:39,011 1. Database 2023-02-24T02:17:39,011 2. Path 2023-02-24T02:17:39,011 3. Entity 2023-02-24T02:17:39,012 4. Measurement 2023-02-24T02:17:39,012 The metadata in the SQLAlchemy are: 2023-02-24T02:17:39,012 1. Schema 2023-02-24T02:17:39,013 2. Table 2023-02-24T02:17:39,013 3. Column 2023-02-24T02:17:39,014 The mapping relationship between them is: 2023-02-24T02:17:39,014 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2023-02-24T02:17:39,014 | -------------------- | ---------------------------------------------- | 2023-02-24T02:17:39,015 | Schema | Database | 2023-02-24T02:17:39,015 | Table | Path ( from database to entity ) + Entity | 2023-02-24T02:17:39,015 | Column | Measurement | 2023-02-24T02:17:39,016 The following figure shows the relationship between the two more intuitively: 2023-02-24T02:17:39,016 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2023-02-24T02:17:39,017 #### Data type mapping 2023-02-24T02:17:39,017 | data type in IoTDB | data type in SQLAlchemy | 2023-02-24T02:17:39,018 |--------------------|-------------------------| 2023-02-24T02:17:39,018 | BOOLEAN | Boolean | 2023-02-24T02:17:39,018 | INT32 | Integer | 2023-02-24T02:17:39,018 | INT64 | BigInteger | 2023-02-24T02:17:39,019 | FLOAT | Float | 2023-02-24T02:17:39,019 | DOUBLE | Float | 2023-02-24T02:17:39,019 | TEXT | Text | 2023-02-24T02:17:39,020 | LONG | BigInteger | 2023-02-24T02:17:39,020 #### Example 2023-02-24T02:17:39,020 + execute statement 2023-02-24T02:17:39,021 ```python 2023-02-24T02:17:39,021 from sqlalchemy import create_engine 2023-02-24T02:17:39,022 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-02-24T02:17:39,022 connect = engine.connect() 2023-02-24T02:17:39,022 result = connect.execute("SELECT ** FROM root") 2023-02-24T02:17:39,023 for row in result.fetchall(): 2023-02-24T02:17:39,023 print(row) 2023-02-24T02:17:39,023 ``` 2023-02-24T02:17:39,024 + ORM (now only simple queries are supported) 2023-02-24T02:17:39,024 ```python 2023-02-24T02:17:39,025 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2023-02-24T02:17:39,025 from sqlalchemy.ext.declarative import declarative_base 2023-02-24T02:17:39,025 from sqlalchemy.orm import sessionmaker 2023-02-24T02:17:39,026 metadata = MetaData( 2023-02-24T02:17:39,026 schema='root.factory' 2023-02-24T02:17:39,026 ) 2023-02-24T02:17:39,027 Base = declarative_base(metadata=metadata) 2023-02-24T02:17:39,028 class Device(Base): 2023-02-24T02:17:39,028 __tablename__ = "room2.device1" 2023-02-24T02:17:39,028 Time = Column(BigInteger, primary_key=True) 2023-02-24T02:17:39,028 temperature = Column(Float) 2023-02-24T02:17:39,029 status = Column(Float) 2023-02-24T02:17:39,030 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-02-24T02:17:39,030 DbSession = sessionmaker(bind=engine) 2023-02-24T02:17:39,030 session = DbSession() 2023-02-24T02:17:39,031 res = session.query(Device.status).filter(Device.temperature > 1) 2023-02-24T02:17:39,032 for row in res: 2023-02-24T02:17:39,032 print(row) 2023-02-24T02:17:39,032 ``` 2023-02-24T02:17:39,033 ## Developers 2023-02-24T02:17:39,034 ### Introduction 2023-02-24T02:17:39,034 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2023-02-24T02:17:39,035 ### Prerequisites 2023-02-24T02:17:39,036 Python3.7 or later is preferred. 2023-02-24T02:17:39,037 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2023-02-24T02:17:39,037 ``` 2023-02-24T02:17:39,038 http://thrift.apache.org/docs/install/ 2023-02-24T02:17:39,038 ``` 2023-02-24T02:17:39,039 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2023-02-24T02:17:39,039 ```shell 2023-02-24T02:17:39,039 pip install -r requirements_dev.txt 2023-02-24T02:17:39,040 ``` 2023-02-24T02:17:39,041 ### Compile the thrift library and Debug 2023-02-24T02:17:39,041 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2023-02-24T02:17:39,042 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2023-02-24T02:17:39,042 This folder is ignored from git and should **never be pushed to git!** 2023-02-24T02:17:39,043 **Notice** Do not upload `iotdb/thrift` to the git repo. 2023-02-24T02:17:39,045 ### Session Client & Example 2023-02-24T02:17:39,045 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2023-02-24T02:17:39,047 Or, another simple example: 2023-02-24T02:17:39,047 ```python 2023-02-24T02:17:39,047 from iotdb.Session import Session 2023-02-24T02:17:39,048 ip = "127.0.0.1" 2023-02-24T02:17:39,048 port_ = "6667" 2023-02-24T02:17:39,049 username_ = "root" 2023-02-24T02:17:39,049 password_ = "root" 2023-02-24T02:17:39,049 session = Session(ip, port_, username_, password_) 2023-02-24T02:17:39,050 session.open(False) 2023-02-24T02:17:39,050 zone = session.get_time_zone() 2023-02-24T02:17:39,050 session.close() 2023-02-24T02:17:39,050 ``` 2023-02-24T02:17:39,052 ### Tests 2023-02-24T02:17:39,052 Please add your custom tests in `tests` folder. 2023-02-24T02:17:39,053 To run all defined tests just type `pytest .` in the root folder. 2023-02-24T02:17:39,053 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2023-02-24T02:17:39,054 ### Futher Tools 2023-02-24T02:17:39,055 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2023-02-24T02:17:39,055 Both can be run by `black .` or `flake8 .` respectively. 2023-02-24T02:17:39,057 ## Releasing 2023-02-24T02:17:39,057 To do a release just ensure that you have the right set of generated thrift files. 2023-02-24T02:17:39,057 Then run linting and auto-formatting. 2023-02-24T02:17:39,058 Then, ensure that all tests work (via `pytest .`). 2023-02-24T02:17:39,058 Then you are good to go to do a release! 2023-02-24T02:17:39,059 ### Preparing your environment 2023-02-24T02:17:39,060 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2023-02-24T02:17:39,061 ### Doing the Release 2023-02-24T02:17:39,062 There is a convenient script `release.sh` to do all steps for a release. 2023-02-24T02:17:39,062 Namely, these are 2023-02-24T02:17:39,062 * Remove all transient directories from last release (if exists) 2023-02-24T02:17:39,063 * (Re-)generate all generated sources via mvn 2023-02-24T02:17:39,063 * Run Linting (flake8) 2023-02-24T02:17:39,063 * Run Tests via pytest 2023-02-24T02:17:39,064 * Build 2023-02-24T02:17:39,064 * Release to pypi 2023-02-24T02:17:39,114 running egg_info 2023-02-24T02:17:39,126 writing apache_iotdb.egg-info/PKG-INFO 2023-02-24T02:17:39,131 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2023-02-24T02:17:39,135 writing entry points to apache_iotdb.egg-info/entry_points.txt 2023-02-24T02:17:39,137 writing requirements to apache_iotdb.egg-info/requires.txt 2023-02-24T02:17:39,140 writing top-level names to apache_iotdb.egg-info/top_level.txt 2023-02-24T02:17:39,208 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-02-24T02:17:39,215 adding license file 'LICENSE' 2023-02-24T02:17:39,228 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-02-24T02:17:39,231 /tmp/pip-build-env-d0tm1w99/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2023-02-24T02:17:39,232 warnings.warn(msg) 2023-02-24T02:17:39,343 Getting requirements to build wheel: finished with status 'done' 2023-02-24T02:17:39,364 Created temporary directory: /tmp/pip-modern-metadata-da47pl9e 2023-02-24T02:17:39,369 Preparing metadata (pyproject.toml): started 2023-02-24T02:17:39,372 Running command Preparing metadata (pyproject.toml) 2023-02-24T02:17:40,481 2023-02-24T02:17:40,489 # Apache IoTDB 2023-02-24T02:17:40,489 [![Python Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml) 2023-02-24T02:17:40,490 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2023-02-24T02:17:40,490 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2023-02-24T02:17:40,490 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2023-02-24T02:17:40,491 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2023-02-24T02:17:40,491 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2023-02-24T02:17:40,491 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2023-02-24T02:17:40,492 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2023-02-24T02:17:40,493 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2023-02-24T02:17:40,493 architecture, high performance and rich feature set together with its deep integration with 2023-02-24T02:17:40,493 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2023-02-24T02:17:40,494 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2023-02-24T02:17:40,495 ## Python Native API 2023-02-24T02:17:40,495 ### Requirements 2023-02-24T02:17:40,496 You have to install thrift (>=0.13) before using the package. 2023-02-24T02:17:40,497 ### How to use (Example) 2023-02-24T02:17:40,498 First, download the latest package: `pip3 install apache-iotdb` 2023-02-24T02:17:40,499 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2023-02-24T02:17:40,499 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2023-02-24T02:17:40,500 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2023-02-24T02:17:40,501 (you need to add `import iotdb` in the head of the file) 2023-02-24T02:17:40,501 Or: 2023-02-24T02:17:40,502 ```python 2023-02-24T02:17:40,502 from iotdb.Session import Session 2023-02-24T02:17:40,503 ip = "127.0.0.1" 2023-02-24T02:17:40,503 port_ = "6667" 2023-02-24T02:17:40,503 username_ = "root" 2023-02-24T02:17:40,504 password_ = "root" 2023-02-24T02:17:40,504 session = Session(ip, port_, username_, password_) 2023-02-24T02:17:40,504 session.open(False) 2023-02-24T02:17:40,505 zone = session.get_time_zone() 2023-02-24T02:17:40,505 session.close() 2023-02-24T02:17:40,505 ``` 2023-02-24T02:17:40,506 ### Initialization 2023-02-24T02:17:40,507 * Initialize a Session 2023-02-24T02:17:40,507 ```python 2023-02-24T02:17:40,508 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2023-02-24T02:17:40,508 ``` 2023-02-24T02:17:40,508 * Open a session, with a parameter to specify whether to enable RPC compression 2023-02-24T02:17:40,509 ```python 2023-02-24T02:17:40,509 session.open(enable_rpc_compression=False) 2023-02-24T02:17:40,510 ``` 2023-02-24T02:17:40,510 Notice: this RPC compression status of client must comply with that of IoTDB server 2023-02-24T02:17:40,511 * Close a Session 2023-02-24T02:17:40,512 ```python 2023-02-24T02:17:40,512 session.close() 2023-02-24T02:17:40,512 ``` 2023-02-24T02:17:40,513 ### Data Definition Interface (DDL Interface) 2023-02-24T02:17:40,513 #### DATABASE Management 2023-02-24T02:17:40,514 * CREATE DATABASE 2023-02-24T02:17:40,515 ```python 2023-02-24T02:17:40,515 session.set_storage_group(group_name) 2023-02-24T02:17:40,515 ``` 2023-02-24T02:17:40,516 * Delete one or several databases 2023-02-24T02:17:40,517 ```python 2023-02-24T02:17:40,517 session.delete_storage_group(group_name) 2023-02-24T02:17:40,517 session.delete_storage_groups(group_name_lst) 2023-02-24T02:17:40,518 ``` 2023-02-24T02:17:40,518 #### Timeseries Management 2023-02-24T02:17:40,519 * Create one or multiple timeseries 2023-02-24T02:17:40,519 ```python 2023-02-24T02:17:40,519 session.create_time_series(ts_path, data_type, encoding, compressor, 2023-02-24T02:17:40,520 props=None, tags=None, attributes=None, alias=None) 2023-02-24T02:17:40,520 session.create_multi_time_series( 2023-02-24T02:17:40,521 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2023-02-24T02:17:40,521 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2023-02-24T02:17:40,521 ) 2023-02-24T02:17:40,522 ``` 2023-02-24T02:17:40,522 * Create aligned timeseries 2023-02-24T02:17:40,523 ```python 2023-02-24T02:17:40,523 session.create_aligned_time_series( 2023-02-24T02:17:40,524 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2023-02-24T02:17:40,524 ) 2023-02-24T02:17:40,524 ``` 2023-02-24T02:17:40,525 Attention: Alias of measurements are **not supported** currently. 2023-02-24T02:17:40,525 * Delete one or several timeseries 2023-02-24T02:17:40,526 ```python 2023-02-24T02:17:40,526 session.delete_time_series(paths_list) 2023-02-24T02:17:40,527 ``` 2023-02-24T02:17:40,527 * Check whether the specific timeseries exists 2023-02-24T02:17:40,528 ```python 2023-02-24T02:17:40,528 session.check_time_series_exists(path) 2023-02-24T02:17:40,529 ``` 2023-02-24T02:17:40,529 ### Data Manipulation Interface (DML Interface) 2023-02-24T02:17:40,530 #### Insert 2023-02-24T02:17:40,531 It is recommended to use insertTablet to help improve write efficiency. 2023-02-24T02:17:40,531 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2023-02-24T02:17:40,531 * **Better Write Performance** 2023-02-24T02:17:40,532 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2023-02-24T02:17:40,533 We have two implementations of Tablet in Python API. 2023-02-24T02:17:40,533 * Normal Tablet 2023-02-24T02:17:40,534 ```python 2023-02-24T02:17:40,534 values_ = [ 2023-02-24T02:17:40,535 [False, 10, 11, 1.1, 10011.1, "test01"], 2023-02-24T02:17:40,535 [True, 100, 11111, 1.25, 101.0, "test02"], 2023-02-24T02:17:40,535 [False, 100, 1, 188.1, 688.25, "test03"], 2023-02-24T02:17:40,535 [True, 0, 0, 0, 6.25, "test04"], 2023-02-24T02:17:40,536 ] 2023-02-24T02:17:40,536 timestamps_ = [1, 2, 3, 4] 2023-02-24T02:17:40,536 tablet_ = Tablet( 2023-02-24T02:17:40,537 device_id, measurements_, data_types_, values_, timestamps_ 2023-02-24T02:17:40,537 ) 2023-02-24T02:17:40,537 session.insert_tablet(tablet_) 2023-02-24T02:17:40,538 ``` 2023-02-24T02:17:40,538 * Numpy Tablet 2023-02-24T02:17:40,539 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2023-02-24T02:17:40,539 With less memory footprint and time cost of serialization, the insert performance will be better. 2023-02-24T02:17:40,539 **Notice** 2023-02-24T02:17:40,540 1. time and value columns in Tablet are ndarray. 2023-02-24T02:17:40,540 2. recommended to use the specific dtypes to each ndarray, see the example below 2023-02-24T02:17:40,540 (if not, the default dtypes are also ok). 2023-02-24T02:17:40,541 ```python 2023-02-24T02:17:40,541 import numpy as np 2023-02-24T02:17:40,541 data_types_ = [ 2023-02-24T02:17:40,542 TSDataType.BOOLEAN, 2023-02-24T02:17:40,542 TSDataType.INT32, 2023-02-24T02:17:40,542 TSDataType.INT64, 2023-02-24T02:17:40,543 TSDataType.FLOAT, 2023-02-24T02:17:40,543 TSDataType.DOUBLE, 2023-02-24T02:17:40,543 TSDataType.TEXT, 2023-02-24T02:17:40,544 ] 2023-02-24T02:17:40,544 np_values_ = [ 2023-02-24T02:17:40,544 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-02-24T02:17:40,545 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-02-24T02:17:40,545 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-02-24T02:17:40,545 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-02-24T02:17:40,546 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-02-24T02:17:40,546 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-02-24T02:17:40,546 ] 2023-02-24T02:17:40,547 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2023-02-24T02:17:40,547 np_tablet_ = NumpyTablet( 2023-02-24T02:17:40,547 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2023-02-24T02:17:40,547 ) 2023-02-24T02:17:40,548 session.insert_tablet(np_tablet_) 2023-02-24T02:17:40,548 ``` 2023-02-24T02:17:40,549 * Insert multiple Tablets 2023-02-24T02:17:40,549 ```python 2023-02-24T02:17:40,550 session.insert_tablets(tablet_lst) 2023-02-24T02:17:40,550 ``` 2023-02-24T02:17:40,550 * Insert a Record 2023-02-24T02:17:40,551 ```python 2023-02-24T02:17:40,551 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2023-02-24T02:17:40,552 ``` 2023-02-24T02:17:40,552 * Insert multiple Records 2023-02-24T02:17:40,553 ```python 2023-02-24T02:17:40,553 session.insert_records( 2023-02-24T02:17:40,553 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2023-02-24T02:17:40,554 ) 2023-02-24T02:17:40,554 ``` 2023-02-24T02:17:40,555 * Insert multiple Records that belong to the same device. 2023-02-24T02:17:40,555 With type info the server has no need to do type inference, which leads a better performance 2023-02-24T02:17:40,556 ```python 2023-02-24T02:17:40,556 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2023-02-24T02:17:40,557 ``` 2023-02-24T02:17:40,557 #### Insert with type inference 2023-02-24T02:17:40,558 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2023-02-24T02:17:40,558 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2023-02-24T02:17:40,559 ```python 2023-02-24T02:17:40,559 session.insert_str_record(device_id, timestamp, measurements, string_values) 2023-02-24T02:17:40,560 ``` 2023-02-24T02:17:40,560 #### Insert of Aligned Timeseries 2023-02-24T02:17:40,561 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2023-02-24T02:17:40,561 * insert_aligned_record 2023-02-24T02:17:40,562 * insert_aligned_records 2023-02-24T02:17:40,562 * insert_aligned_records_of_one_device 2023-02-24T02:17:40,562 * insert_aligned_tablet 2023-02-24T02:17:40,563 * insert_aligned_tablets 2023-02-24T02:17:40,564 ### IoTDB-SQL Interface 2023-02-24T02:17:40,564 * Execute query statement 2023-02-24T02:17:40,565 ```python 2023-02-24T02:17:40,565 session.execute_query_statement(sql) 2023-02-24T02:17:40,566 ``` 2023-02-24T02:17:40,566 * Execute non query statement 2023-02-24T02:17:40,567 ```python 2023-02-24T02:17:40,567 session.execute_non_query_statement(sql) 2023-02-24T02:17:40,568 ``` 2023-02-24T02:17:40,568 * Execute statement 2023-02-24T02:17:40,569 ```python 2023-02-24T02:17:40,569 session.execute_statement(sql) 2023-02-24T02:17:40,569 ``` 2023-02-24T02:17:40,570 ### Schema Template 2023-02-24T02:17:40,570 #### Create Schema Template 2023-02-24T02:17:40,571 The step for creating a metadata template is as follows 2023-02-24T02:17:40,571 1. Create the template class 2023-02-24T02:17:40,571 2. Adding child Node,InternalNode and MeasurementNode can be chose 2023-02-24T02:17:40,571 3. Execute create schema template function 2023-02-24T02:17:40,572 ```python 2023-02-24T02:17:40,572 template = Template(name=template_name, share_time=True) 2023-02-24T02:17:40,573 i_node_gps = InternalNode(name="GPS", share_time=False) 2023-02-24T02:17:40,573 i_node_v = InternalNode(name="vehicle", share_time=True) 2023-02-24T02:17:40,574 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2023-02-24T02:17:40,574 i_node_gps.add_child(m_node_x) 2023-02-24T02:17:40,574 i_node_v.add_child(m_node_x) 2023-02-24T02:17:40,575 template.add_template(i_node_gps) 2023-02-24T02:17:40,575 template.add_template(i_node_v) 2023-02-24T02:17:40,576 template.add_template(m_node_x) 2023-02-24T02:17:40,576 session.create_schema_template(template) 2023-02-24T02:17:40,577 ``` 2023-02-24T02:17:40,577 #### Modify Schema Template nodes 2023-02-24T02:17:40,577 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2023-02-24T02:17:40,578 * add node in template 2023-02-24T02:17:40,578 ```python 2023-02-24T02:17:40,579 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2023-02-24T02:17:40,579 ``` 2023-02-24T02:17:40,580 * delete node in template 2023-02-24T02:17:40,580 ```python 2023-02-24T02:17:40,581 session.delete_node_in_template(template_name, path) 2023-02-24T02:17:40,581 ``` 2023-02-24T02:17:40,582 #### Set Schema Template 2023-02-24T02:17:40,582 ```python 2023-02-24T02:17:40,583 session.set_schema_template(template_name, prefix_path) 2023-02-24T02:17:40,583 ``` 2023-02-24T02:17:40,584 #### Uset Schema Template 2023-02-24T02:17:40,584 ```python 2023-02-24T02:17:40,585 session.unset_schema_template(template_name, prefix_path) 2023-02-24T02:17:40,585 ``` 2023-02-24T02:17:40,586 #### Show Schema Template 2023-02-24T02:17:40,587 * Show all schema templates 2023-02-24T02:17:40,587 ```python 2023-02-24T02:17:40,587 session.show_all_templates() 2023-02-24T02:17:40,588 ``` 2023-02-24T02:17:40,588 * Count all nodes in templates 2023-02-24T02:17:40,588 ```python 2023-02-24T02:17:40,589 session.count_measurements_in_template(template_name) 2023-02-24T02:17:40,589 ``` 2023-02-24T02:17:40,589 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2023-02-24T02:17:40,590 ```python 2023-02-24T02:17:40,590 session.count_measurements_in_template(template_name, path) 2023-02-24T02:17:40,590 ``` 2023-02-24T02:17:40,591 * Judge whether the path is exist or not in templates, This path may not belong to the template 2023-02-24T02:17:40,591 ```python 2023-02-24T02:17:40,592 session.is_path_exist_in_template(template_name, path) 2023-02-24T02:17:40,592 ``` 2023-02-24T02:17:40,592 * Show nodes under in schema template 2023-02-24T02:17:40,593 ```python 2023-02-24T02:17:40,593 session.show_measurements_in_template(template_name) 2023-02-24T02:17:40,593 ``` 2023-02-24T02:17:40,594 * Show the path prefix where a schema template is set 2023-02-24T02:17:40,594 ```python 2023-02-24T02:17:40,595 session.show_paths_template_set_on(template_name) 2023-02-24T02:17:40,595 ``` 2023-02-24T02:17:40,595 * Show the path prefix where a schema template is used (i.e. the time series has been created) 2023-02-24T02:17:40,596 ```python 2023-02-24T02:17:40,596 session.show_paths_template_using_on(template_name) 2023-02-24T02:17:40,596 ``` 2023-02-24T02:17:40,597 #### Drop Schema Template 2023-02-24T02:17:40,597 Delete an existing metadata template,dropping an already set template is not supported 2023-02-24T02:17:40,598 ```python 2023-02-24T02:17:40,598 session.drop_schema_template("template_python") 2023-02-24T02:17:40,598 ``` 2023-02-24T02:17:40,599 ### Pandas Support 2023-02-24T02:17:40,600 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2023-02-24T02:17:40,600 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2023-02-24T02:17:40,601 Example: 2023-02-24T02:17:40,601 ```python 2023-02-24T02:17:40,601 from iotdb.Session import Session 2023-02-24T02:17:40,602 ip = "127.0.0.1" 2023-02-24T02:17:40,602 port_ = "6667" 2023-02-24T02:17:40,602 username_ = "root" 2023-02-24T02:17:40,603 password_ = "root" 2023-02-24T02:17:40,603 session = Session(ip, port_, username_, password_) 2023-02-24T02:17:40,603 session.open(False) 2023-02-24T02:17:40,604 result = session.execute_query_statement("SELECT * FROM root.*") 2023-02-24T02:17:40,604 # Transform to Pandas Dataset 2023-02-24T02:17:40,605 df = result.todf() 2023-02-24T02:17:40,605 session.close() 2023-02-24T02:17:40,606 # Now you can work with the dataframe 2023-02-24T02:17:40,606 df = ... 2023-02-24T02:17:40,607 ``` 2023-02-24T02:17:40,607 ### IoTDB Testcontainer 2023-02-24T02:17:40,608 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2023-02-24T02:17:40,609 To start (and stop) an IoTDB Database in a Docker container simply do: 2023-02-24T02:17:40,609 ```python 2023-02-24T02:17:40,609 class MyTestCase(unittest.TestCase): 2023-02-24T02:17:40,610 def test_something(self): 2023-02-24T02:17:40,610 with IoTDBContainer() as c: 2023-02-24T02:17:40,611 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2023-02-24T02:17:40,611 session.open(False) 2023-02-24T02:17:40,611 result = session.execute_query_statement("SHOW TIMESERIES") 2023-02-24T02:17:40,612 print(result) 2023-02-24T02:17:40,612 session.close() 2023-02-24T02:17:40,612 ``` 2023-02-24T02:17:40,613 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2023-02-24T02:17:40,614 ### IoTDB DBAPI 2023-02-24T02:17:40,614 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2023-02-24T02:17:40,615 interface for accessing databases in Python. 2023-02-24T02:17:40,615 #### Examples 2023-02-24T02:17:40,616 + Initialization 2023-02-24T02:17:40,616 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2023-02-24T02:17:40,617 ```python 2023-02-24T02:17:40,617 from iotdb.dbapi import connect 2023-02-24T02:17:40,618 ip = "127.0.0.1" 2023-02-24T02:17:40,618 port_ = "6667" 2023-02-24T02:17:40,618 username_ = "root" 2023-02-24T02:17:40,619 password_ = "root" 2023-02-24T02:17:40,619 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2023-02-24T02:17:40,619 cursor = conn.cursor() 2023-02-24T02:17:40,619 ``` 2023-02-24T02:17:40,620 + simple SQL statement execution 2023-02-24T02:17:40,620 ```python 2023-02-24T02:17:40,620 cursor.execute("SELECT * FROM root.*") 2023-02-24T02:17:40,621 for row in cursor.fetchall(): 2023-02-24T02:17:40,621 print(row) 2023-02-24T02:17:40,621 ``` 2023-02-24T02:17:40,622 + execute SQL with parameter 2023-02-24T02:17:40,622 IoTDB DBAPI supports pyformat style parameters 2023-02-24T02:17:40,623 ```python 2023-02-24T02:17:40,623 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2023-02-24T02:17:40,623 for row in cursor.fetchall(): 2023-02-24T02:17:40,624 print(row) 2023-02-24T02:17:40,624 ``` 2023-02-24T02:17:40,625 + execute SQL with parameter sequences 2023-02-24T02:17:40,625 ```python 2023-02-24T02:17:40,625 seq_of_parameters = [ 2023-02-24T02:17:40,626 {"timestamp": 1, "temperature": 1}, 2023-02-24T02:17:40,626 {"timestamp": 2, "temperature": 2}, 2023-02-24T02:17:40,626 {"timestamp": 3, "temperature": 3}, 2023-02-24T02:17:40,627 {"timestamp": 4, "temperature": 4}, 2023-02-24T02:17:40,627 {"timestamp": 5, "temperature": 5}, 2023-02-24T02:17:40,627 ] 2023-02-24T02:17:40,627 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2023-02-24T02:17:40,628 cursor.executemany(sql,seq_of_parameters) 2023-02-24T02:17:40,628 ``` 2023-02-24T02:17:40,629 + close the connection and cursor 2023-02-24T02:17:40,629 ```python 2023-02-24T02:17:40,629 cursor.close() 2023-02-24T02:17:40,630 conn.close() 2023-02-24T02:17:40,630 ``` 2023-02-24T02:17:40,630 ### IoTDB SQLAlchemy Dialect (Experimental) 2023-02-24T02:17:40,631 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2023-02-24T02:17:40,631 This part is still being improved. 2023-02-24T02:17:40,631 Please do not use it in the production environment! 2023-02-24T02:17:40,632 #### Mapping of the metadata 2023-02-24T02:17:40,632 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2023-02-24T02:17:40,632 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2023-02-24T02:17:40,633 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2023-02-24T02:17:40,633 Converting the data model of IoTDB into the data model of SQLAlchemy. 2023-02-24T02:17:40,634 The metadata in the IoTDB are: 2023-02-24T02:17:40,634 1. Database 2023-02-24T02:17:40,635 2. Path 2023-02-24T02:17:40,635 3. Entity 2023-02-24T02:17:40,635 4. Measurement 2023-02-24T02:17:40,636 The metadata in the SQLAlchemy are: 2023-02-24T02:17:40,636 1. Schema 2023-02-24T02:17:40,636 2. Table 2023-02-24T02:17:40,637 3. Column 2023-02-24T02:17:40,637 The mapping relationship between them is: 2023-02-24T02:17:40,638 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2023-02-24T02:17:40,638 | -------------------- | ---------------------------------------------- | 2023-02-24T02:17:40,639 | Schema | Database | 2023-02-24T02:17:40,639 | Table | Path ( from database to entity ) + Entity | 2023-02-24T02:17:40,639 | Column | Measurement | 2023-02-24T02:17:40,640 The following figure shows the relationship between the two more intuitively: 2023-02-24T02:17:40,641 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2023-02-24T02:17:40,641 #### Data type mapping 2023-02-24T02:17:40,642 | data type in IoTDB | data type in SQLAlchemy | 2023-02-24T02:17:40,642 |--------------------|-------------------------| 2023-02-24T02:17:40,642 | BOOLEAN | Boolean | 2023-02-24T02:17:40,643 | INT32 | Integer | 2023-02-24T02:17:40,643 | INT64 | BigInteger | 2023-02-24T02:17:40,643 | FLOAT | Float | 2023-02-24T02:17:40,644 | DOUBLE | Float | 2023-02-24T02:17:40,644 | TEXT | Text | 2023-02-24T02:17:40,644 | LONG | BigInteger | 2023-02-24T02:17:40,645 #### Example 2023-02-24T02:17:40,645 + execute statement 2023-02-24T02:17:40,646 ```python 2023-02-24T02:17:40,646 from sqlalchemy import create_engine 2023-02-24T02:17:40,647 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-02-24T02:17:40,647 connect = engine.connect() 2023-02-24T02:17:40,647 result = connect.execute("SELECT ** FROM root") 2023-02-24T02:17:40,648 for row in result.fetchall(): 2023-02-24T02:17:40,648 print(row) 2023-02-24T02:17:40,648 ``` 2023-02-24T02:17:40,649 + ORM (now only simple queries are supported) 2023-02-24T02:17:40,650 ```python 2023-02-24T02:17:40,650 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2023-02-24T02:17:40,650 from sqlalchemy.ext.declarative import declarative_base 2023-02-24T02:17:40,651 from sqlalchemy.orm import sessionmaker 2023-02-24T02:17:40,651 metadata = MetaData( 2023-02-24T02:17:40,651 schema='root.factory' 2023-02-24T02:17:40,652 ) 2023-02-24T02:17:40,652 Base = declarative_base(metadata=metadata) 2023-02-24T02:17:40,653 class Device(Base): 2023-02-24T02:17:40,653 __tablename__ = "room2.device1" 2023-02-24T02:17:40,654 Time = Column(BigInteger, primary_key=True) 2023-02-24T02:17:40,654 temperature = Column(Float) 2023-02-24T02:17:40,654 status = Column(Float) 2023-02-24T02:17:40,655 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-02-24T02:17:40,656 DbSession = sessionmaker(bind=engine) 2023-02-24T02:17:40,656 session = DbSession() 2023-02-24T02:17:40,657 res = session.query(Device.status).filter(Device.temperature > 1) 2023-02-24T02:17:40,658 for row in res: 2023-02-24T02:17:40,658 print(row) 2023-02-24T02:17:40,658 ``` 2023-02-24T02:17:40,659 ## Developers 2023-02-24T02:17:40,660 ### Introduction 2023-02-24T02:17:40,660 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2023-02-24T02:17:40,662 ### Prerequisites 2023-02-24T02:17:40,662 Python3.7 or later is preferred. 2023-02-24T02:17:40,663 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2023-02-24T02:17:40,664 ``` 2023-02-24T02:17:40,664 http://thrift.apache.org/docs/install/ 2023-02-24T02:17:40,664 ``` 2023-02-24T02:17:40,665 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2023-02-24T02:17:40,665 ```shell 2023-02-24T02:17:40,665 pip install -r requirements_dev.txt 2023-02-24T02:17:40,666 ``` 2023-02-24T02:17:40,667 ### Compile the thrift library and Debug 2023-02-24T02:17:40,668 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2023-02-24T02:17:40,668 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2023-02-24T02:17:40,669 This folder is ignored from git and should **never be pushed to git!** 2023-02-24T02:17:40,669 **Notice** Do not upload `iotdb/thrift` to the git repo. 2023-02-24T02:17:40,671 ### Session Client & Example 2023-02-24T02:17:40,671 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2023-02-24T02:17:40,672 Or, another simple example: 2023-02-24T02:17:40,673 ```python 2023-02-24T02:17:40,673 from iotdb.Session import Session 2023-02-24T02:17:40,674 ip = "127.0.0.1" 2023-02-24T02:17:40,674 port_ = "6667" 2023-02-24T02:17:40,675 username_ = "root" 2023-02-24T02:17:40,675 password_ = "root" 2023-02-24T02:17:40,675 session = Session(ip, port_, username_, password_) 2023-02-24T02:17:40,676 session.open(False) 2023-02-24T02:17:40,676 zone = session.get_time_zone() 2023-02-24T02:17:40,676 session.close() 2023-02-24T02:17:40,677 ``` 2023-02-24T02:17:40,678 ### Tests 2023-02-24T02:17:40,678 Please add your custom tests in `tests` folder. 2023-02-24T02:17:40,679 To run all defined tests just type `pytest .` in the root folder. 2023-02-24T02:17:40,680 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2023-02-24T02:17:40,681 ### Futher Tools 2023-02-24T02:17:40,682 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2023-02-24T02:17:40,682 Both can be run by `black .` or `flake8 .` respectively. 2023-02-24T02:17:40,683 ## Releasing 2023-02-24T02:17:40,684 To do a release just ensure that you have the right set of generated thrift files. 2023-02-24T02:17:40,684 Then run linting and auto-formatting. 2023-02-24T02:17:40,684 Then, ensure that all tests work (via `pytest .`). 2023-02-24T02:17:40,685 Then you are good to go to do a release! 2023-02-24T02:17:40,686 ### Preparing your environment 2023-02-24T02:17:40,687 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2023-02-24T02:17:40,688 ### Doing the Release 2023-02-24T02:17:40,688 There is a convenient script `release.sh` to do all steps for a release. 2023-02-24T02:17:40,689 Namely, these are 2023-02-24T02:17:40,689 * Remove all transient directories from last release (if exists) 2023-02-24T02:17:40,690 * (Re-)generate all generated sources via mvn 2023-02-24T02:17:40,690 * Run Linting (flake8) 2023-02-24T02:17:40,690 * Run Tests via pytest 2023-02-24T02:17:40,690 * Build 2023-02-24T02:17:40,691 * Release to pypi 2023-02-24T02:17:40,692 running dist_info 2023-02-24T02:17:40,693 creating /tmp/pip-modern-metadata-da47pl9e/apache_iotdb.egg-info 2023-02-24T02:17:40,693 writing /tmp/pip-modern-metadata-da47pl9e/apache_iotdb.egg-info/PKG-INFO 2023-02-24T02:17:40,697 writing dependency_links to /tmp/pip-modern-metadata-da47pl9e/apache_iotdb.egg-info/dependency_links.txt 2023-02-24T02:17:40,701 writing entry points to /tmp/pip-modern-metadata-da47pl9e/apache_iotdb.egg-info/entry_points.txt 2023-02-24T02:17:40,704 writing requirements to /tmp/pip-modern-metadata-da47pl9e/apache_iotdb.egg-info/requires.txt 2023-02-24T02:17:40,706 writing top-level names to /tmp/pip-modern-metadata-da47pl9e/apache_iotdb.egg-info/top_level.txt 2023-02-24T02:17:40,709 writing manifest file '/tmp/pip-modern-metadata-da47pl9e/apache_iotdb.egg-info/SOURCES.txt' 2023-02-24T02:17:40,773 reading manifest file '/tmp/pip-modern-metadata-da47pl9e/apache_iotdb.egg-info/SOURCES.txt' 2023-02-24T02:17:40,778 adding license file 'LICENSE' 2023-02-24T02:17:40,787 writing manifest file '/tmp/pip-modern-metadata-da47pl9e/apache_iotdb.egg-info/SOURCES.txt' 2023-02-24T02:17:40,790 creating '/tmp/pip-modern-metadata-da47pl9e/apache_iotdb-1.0.1.dist-info' 2023-02-24T02:17:41,201 /tmp/pip-build-env-d0tm1w99/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2023-02-24T02:17:41,201 warnings.warn(msg) 2023-02-24T02:17:41,340 Preparing metadata (pyproject.toml): finished with status 'done' 2023-02-24T02:17:41,360 Source in /tmp/pip-wheel-zengubrd/apache-iotdb_d73743fc6c37431aab5e6a083b4ff31e has version 1.0.1, which satisfies requirement apache-iotdb==1.0.1 from https://files.pythonhosted.org/packages/0b/d7/475e11d05f2d4bc65f9b7d14691158489fbb7726a26cee5a016e94e6640a/apache-iotdb-1.0.1.tar.gz 2023-02-24T02:17:41,362 Removed apache-iotdb==1.0.1 from https://files.pythonhosted.org/packages/0b/d7/475e11d05f2d4bc65f9b7d14691158489fbb7726a26cee5a016e94e6640a/apache-iotdb-1.0.1.tar.gz from build tracker '/tmp/pip-build-tracker-86ik_8ez' 2023-02-24T02:17:41,381 Created temporary directory: /tmp/pip-unpack-_vubky8b 2023-02-24T02:17:41,382 Building wheels for collected packages: apache-iotdb 2023-02-24T02:17:41,391 Created temporary directory: /tmp/pip-wheel-c959qupx 2023-02-24T02:17:41,392 Destination directory: /tmp/pip-wheel-c959qupx 2023-02-24T02:17:41,397 Building wheel for apache-iotdb (pyproject.toml): started 2023-02-24T02:17:41,399 Running command Building wheel for apache-iotdb (pyproject.toml) 2023-02-24T02:17:42,479 2023-02-24T02:17:42,487 # Apache IoTDB 2023-02-24T02:17:42,488 [![Python Client](https://github.com/apache/iotdb/actions/workflows/client-python.yml/badge.svg?branch=master)](https://github.com/apache/iotdb/actions/workflows/client-python.yml) 2023-02-24T02:17:42,489 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2023-02-24T02:17:42,489 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2023-02-24T02:17:42,490 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2023-02-24T02:17:42,490 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2023-02-24T02:17:42,490 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2023-02-24T02:17:42,491 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2023-02-24T02:17:42,492 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2023-02-24T02:17:42,492 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2023-02-24T02:17:42,493 architecture, high performance and rich feature set together with its deep integration with 2023-02-24T02:17:42,493 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2023-02-24T02:17:42,493 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2023-02-24T02:17:42,494 ## Python Native API 2023-02-24T02:17:42,495 ### Requirements 2023-02-24T02:17:42,496 You have to install thrift (>=0.13) before using the package. 2023-02-24T02:17:42,497 ### How to use (Example) 2023-02-24T02:17:42,498 First, download the latest package: `pip3 install apache-iotdb` 2023-02-24T02:17:42,499 *Notice: If you are installing Python API v0.13.0, DO NOT install by `pip install apache-iotdb==0.13.0`, use `pip install apache-iotdb==0.13.0.post1` instead!* 2023-02-24T02:17:42,499 You can get an example of using the package to read and write data at here: [Example](https://github.com/apache/iotdb/blob/master/client-py/SessionExample.py) 2023-02-24T02:17:42,500 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2023-02-24T02:17:42,501 (you need to add `import iotdb` in the head of the file) 2023-02-24T02:17:42,501 Or: 2023-02-24T02:17:42,502 ```python 2023-02-24T02:17:42,502 from iotdb.Session import Session 2023-02-24T02:17:42,503 ip = "127.0.0.1" 2023-02-24T02:17:42,503 port_ = "6667" 2023-02-24T02:17:42,503 username_ = "root" 2023-02-24T02:17:42,504 password_ = "root" 2023-02-24T02:17:42,504 session = Session(ip, port_, username_, password_) 2023-02-24T02:17:42,504 session.open(False) 2023-02-24T02:17:42,505 zone = session.get_time_zone() 2023-02-24T02:17:42,505 session.close() 2023-02-24T02:17:42,505 ``` 2023-02-24T02:17:42,506 ### Initialization 2023-02-24T02:17:42,507 * Initialize a Session 2023-02-24T02:17:42,507 ```python 2023-02-24T02:17:42,508 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2023-02-24T02:17:42,508 ``` 2023-02-24T02:17:42,509 * Open a session, with a parameter to specify whether to enable RPC compression 2023-02-24T02:17:42,509 ```python 2023-02-24T02:17:42,510 session.open(enable_rpc_compression=False) 2023-02-24T02:17:42,510 ``` 2023-02-24T02:17:42,511 Notice: this RPC compression status of client must comply with that of IoTDB server 2023-02-24T02:17:42,511 * Close a Session 2023-02-24T02:17:42,512 ```python 2023-02-24T02:17:42,512 session.close() 2023-02-24T02:17:42,513 ``` 2023-02-24T02:17:42,513 ### Data Definition Interface (DDL Interface) 2023-02-24T02:17:42,514 #### DATABASE Management 2023-02-24T02:17:42,515 * CREATE DATABASE 2023-02-24T02:17:42,515 ```python 2023-02-24T02:17:42,516 session.set_storage_group(group_name) 2023-02-24T02:17:42,516 ``` 2023-02-24T02:17:42,517 * Delete one or several databases 2023-02-24T02:17:42,517 ```python 2023-02-24T02:17:42,517 session.delete_storage_group(group_name) 2023-02-24T02:17:42,518 session.delete_storage_groups(group_name_lst) 2023-02-24T02:17:42,518 ``` 2023-02-24T02:17:42,518 #### Timeseries Management 2023-02-24T02:17:42,519 * Create one or multiple timeseries 2023-02-24T02:17:42,520 ```python 2023-02-24T02:17:42,520 session.create_time_series(ts_path, data_type, encoding, compressor, 2023-02-24T02:17:42,520 props=None, tags=None, attributes=None, alias=None) 2023-02-24T02:17:42,521 session.create_multi_time_series( 2023-02-24T02:17:42,521 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2023-02-24T02:17:42,522 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2023-02-24T02:17:42,522 ) 2023-02-24T02:17:42,522 ``` 2023-02-24T02:17:42,523 * Create aligned timeseries 2023-02-24T02:17:42,524 ```python 2023-02-24T02:17:42,524 session.create_aligned_time_series( 2023-02-24T02:17:42,524 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2023-02-24T02:17:42,525 ) 2023-02-24T02:17:42,525 ``` 2023-02-24T02:17:42,526 Attention: Alias of measurements are **not supported** currently. 2023-02-24T02:17:42,526 * Delete one or several timeseries 2023-02-24T02:17:42,527 ```python 2023-02-24T02:17:42,527 session.delete_time_series(paths_list) 2023-02-24T02:17:42,528 ``` 2023-02-24T02:17:42,528 * Check whether the specific timeseries exists 2023-02-24T02:17:42,529 ```python 2023-02-24T02:17:42,529 session.check_time_series_exists(path) 2023-02-24T02:17:42,530 ``` 2023-02-24T02:17:42,530 ### Data Manipulation Interface (DML Interface) 2023-02-24T02:17:42,531 #### Insert 2023-02-24T02:17:42,531 It is recommended to use insertTablet to help improve write efficiency. 2023-02-24T02:17:42,532 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2023-02-24T02:17:42,532 * **Better Write Performance** 2023-02-24T02:17:42,533 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2023-02-24T02:17:42,533 We have two implementations of Tablet in Python API. 2023-02-24T02:17:42,534 * Normal Tablet 2023-02-24T02:17:42,535 ```python 2023-02-24T02:17:42,535 values_ = [ 2023-02-24T02:17:42,535 [False, 10, 11, 1.1, 10011.1, "test01"], 2023-02-24T02:17:42,535 [True, 100, 11111, 1.25, 101.0, "test02"], 2023-02-24T02:17:42,536 [False, 100, 1, 188.1, 688.25, "test03"], 2023-02-24T02:17:42,536 [True, 0, 0, 0, 6.25, "test04"], 2023-02-24T02:17:42,536 ] 2023-02-24T02:17:42,537 timestamps_ = [1, 2, 3, 4] 2023-02-24T02:17:42,537 tablet_ = Tablet( 2023-02-24T02:17:42,537 device_id, measurements_, data_types_, values_, timestamps_ 2023-02-24T02:17:42,538 ) 2023-02-24T02:17:42,538 session.insert_tablet(tablet_) 2023-02-24T02:17:42,538 ``` 2023-02-24T02:17:42,539 * Numpy Tablet 2023-02-24T02:17:42,539 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2023-02-24T02:17:42,539 With less memory footprint and time cost of serialization, the insert performance will be better. 2023-02-24T02:17:42,540 **Notice** 2023-02-24T02:17:42,540 1. time and value columns in Tablet are ndarray. 2023-02-24T02:17:42,541 2. recommended to use the specific dtypes to each ndarray, see the example below 2023-02-24T02:17:42,541 (if not, the default dtypes are also ok). 2023-02-24T02:17:42,542 ```python 2023-02-24T02:17:42,542 import numpy as np 2023-02-24T02:17:42,542 data_types_ = [ 2023-02-24T02:17:42,542 TSDataType.BOOLEAN, 2023-02-24T02:17:42,543 TSDataType.INT32, 2023-02-24T02:17:42,543 TSDataType.INT64, 2023-02-24T02:17:42,543 TSDataType.FLOAT, 2023-02-24T02:17:42,544 TSDataType.DOUBLE, 2023-02-24T02:17:42,544 TSDataType.TEXT, 2023-02-24T02:17:42,544 ] 2023-02-24T02:17:42,545 np_values_ = [ 2023-02-24T02:17:42,545 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2023-02-24T02:17:42,545 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2023-02-24T02:17:42,546 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2023-02-24T02:17:42,546 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2023-02-24T02:17:42,546 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2023-02-24T02:17:42,547 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2023-02-24T02:17:42,547 ] 2023-02-24T02:17:42,547 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2023-02-24T02:17:42,548 np_tablet_ = NumpyTablet( 2023-02-24T02:17:42,548 "root.sg_test_01.d_02", measurements_, data_types_, np_values_, np_timestamps_ 2023-02-24T02:17:42,548 ) 2023-02-24T02:17:42,548 session.insert_tablet(np_tablet_) 2023-02-24T02:17:42,549 ``` 2023-02-24T02:17:42,549 * Insert multiple Tablets 2023-02-24T02:17:42,550 ```python 2023-02-24T02:17:42,550 session.insert_tablets(tablet_lst) 2023-02-24T02:17:42,551 ``` 2023-02-24T02:17:42,551 * Insert a Record 2023-02-24T02:17:42,552 ```python 2023-02-24T02:17:42,552 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2023-02-24T02:17:42,552 ``` 2023-02-24T02:17:42,553 * Insert multiple Records 2023-02-24T02:17:42,553 ```python 2023-02-24T02:17:42,554 session.insert_records( 2023-02-24T02:17:42,554 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2023-02-24T02:17:42,554 ) 2023-02-24T02:17:42,555 ``` 2023-02-24T02:17:42,555 * Insert multiple Records that belong to the same device. 2023-02-24T02:17:42,556 With type info the server has no need to do type inference, which leads a better performance 2023-02-24T02:17:42,557 ```python 2023-02-24T02:17:42,557 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2023-02-24T02:17:42,557 ``` 2023-02-24T02:17:42,558 #### Insert with type inference 2023-02-24T02:17:42,559 When the data is of String type, we can use the following interface to perform type inference based on the value of the value itself. For example, if value is "true" , it can be automatically inferred to be a boolean type. If value is "3.2" , it can be automatically inferred as a flout type. Without type information, server has to do type inference, which may cost some time. 2023-02-24T02:17:42,559 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2023-02-24T02:17:42,560 ```python 2023-02-24T02:17:42,560 session.insert_str_record(device_id, timestamp, measurements, string_values) 2023-02-24T02:17:42,561 ``` 2023-02-24T02:17:42,561 #### Insert of Aligned Timeseries 2023-02-24T02:17:42,562 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2023-02-24T02:17:42,562 * insert_aligned_record 2023-02-24T02:17:42,563 * insert_aligned_records 2023-02-24T02:17:42,563 * insert_aligned_records_of_one_device 2023-02-24T02:17:42,563 * insert_aligned_tablet 2023-02-24T02:17:42,564 * insert_aligned_tablets 2023-02-24T02:17:42,565 ### IoTDB-SQL Interface 2023-02-24T02:17:42,565 * Execute query statement 2023-02-24T02:17:42,566 ```python 2023-02-24T02:17:42,566 session.execute_query_statement(sql) 2023-02-24T02:17:42,567 ``` 2023-02-24T02:17:42,567 * Execute non query statement 2023-02-24T02:17:42,568 ```python 2023-02-24T02:17:42,568 session.execute_non_query_statement(sql) 2023-02-24T02:17:42,568 ``` 2023-02-24T02:17:42,569 * Execute statement 2023-02-24T02:17:42,570 ```python 2023-02-24T02:17:42,570 session.execute_statement(sql) 2023-02-24T02:17:42,570 ``` 2023-02-24T02:17:42,571 ### Schema Template 2023-02-24T02:17:42,571 #### Create Schema Template 2023-02-24T02:17:42,572 The step for creating a metadata template is as follows 2023-02-24T02:17:42,572 1. Create the template class 2023-02-24T02:17:42,572 2. Adding child Node,InternalNode and MeasurementNode can be chose 2023-02-24T02:17:42,573 3. Execute create schema template function 2023-02-24T02:17:42,574 ```python 2023-02-24T02:17:42,574 template = Template(name=template_name, share_time=True) 2023-02-24T02:17:42,575 i_node_gps = InternalNode(name="GPS", share_time=False) 2023-02-24T02:17:42,575 i_node_v = InternalNode(name="vehicle", share_time=True) 2023-02-24T02:17:42,575 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2023-02-24T02:17:42,576 i_node_gps.add_child(m_node_x) 2023-02-24T02:17:42,576 i_node_v.add_child(m_node_x) 2023-02-24T02:17:42,577 template.add_template(i_node_gps) 2023-02-24T02:17:42,578 template.add_template(i_node_v) 2023-02-24T02:17:42,578 template.add_template(m_node_x) 2023-02-24T02:17:42,579 session.create_schema_template(template) 2023-02-24T02:17:42,580 ``` 2023-02-24T02:17:42,581 #### Modify Schema Template nodes 2023-02-24T02:17:42,581 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2023-02-24T02:17:42,581 * add node in template 2023-02-24T02:17:42,582 ```python 2023-02-24T02:17:42,582 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2023-02-24T02:17:42,583 ``` 2023-02-24T02:17:42,583 * delete node in template 2023-02-24T02:17:42,584 ```python 2023-02-24T02:17:42,584 session.delete_node_in_template(template_name, path) 2023-02-24T02:17:42,584 ``` 2023-02-24T02:17:42,585 #### Set Schema Template 2023-02-24T02:17:42,585 ```python 2023-02-24T02:17:42,586 session.set_schema_template(template_name, prefix_path) 2023-02-24T02:17:42,586 ``` 2023-02-24T02:17:42,587 #### Uset Schema Template 2023-02-24T02:17:42,587 ```python 2023-02-24T02:17:42,587 session.unset_schema_template(template_name, prefix_path) 2023-02-24T02:17:42,588 ``` 2023-02-24T02:17:42,588 #### Show Schema Template 2023-02-24T02:17:42,589 * Show all schema templates 2023-02-24T02:17:42,589 ```python 2023-02-24T02:17:42,589 session.show_all_templates() 2023-02-24T02:17:42,589 ``` 2023-02-24T02:17:42,590 * Count all nodes in templates 2023-02-24T02:17:42,590 ```python 2023-02-24T02:17:42,590 session.count_measurements_in_template(template_name) 2023-02-24T02:17:42,591 ``` 2023-02-24T02:17:42,591 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2023-02-24T02:17:42,591 ```python 2023-02-24T02:17:42,592 session.count_measurements_in_template(template_name, path) 2023-02-24T02:17:42,592 ``` 2023-02-24T02:17:42,593 * Judge whether the path is exist or not in templates, This path may not belong to the template 2023-02-24T02:17:42,593 ```python 2023-02-24T02:17:42,593 session.is_path_exist_in_template(template_name, path) 2023-02-24T02:17:42,594 ``` 2023-02-24T02:17:42,594 * Show nodes under in schema template 2023-02-24T02:17:42,595 ```python 2023-02-24T02:17:42,595 session.show_measurements_in_template(template_name) 2023-02-24T02:17:42,595 ``` 2023-02-24T02:17:42,596 * Show the path prefix where a schema template is set 2023-02-24T02:17:42,596 ```python 2023-02-24T02:17:42,596 session.show_paths_template_set_on(template_name) 2023-02-24T02:17:42,597 ``` 2023-02-24T02:17:42,597 * Show the path prefix where a schema template is used (i.e. the time series has been created) 2023-02-24T02:17:42,598 ```python 2023-02-24T02:17:42,598 session.show_paths_template_using_on(template_name) 2023-02-24T02:17:42,598 ``` 2023-02-24T02:17:42,599 #### Drop Schema Template 2023-02-24T02:17:42,599 Delete an existing metadata template,dropping an already set template is not supported 2023-02-24T02:17:42,599 ```python 2023-02-24T02:17:42,600 session.drop_schema_template("template_python") 2023-02-24T02:17:42,600 ``` 2023-02-24T02:17:42,601 ### Pandas Support 2023-02-24T02:17:42,602 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2023-02-24T02:17:42,602 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2023-02-24T02:17:42,603 Example: 2023-02-24T02:17:42,603 ```python 2023-02-24T02:17:42,604 from iotdb.Session import Session 2023-02-24T02:17:42,604 ip = "127.0.0.1" 2023-02-24T02:17:42,604 port_ = "6667" 2023-02-24T02:17:42,605 username_ = "root" 2023-02-24T02:17:42,605 password_ = "root" 2023-02-24T02:17:42,605 session = Session(ip, port_, username_, password_) 2023-02-24T02:17:42,606 session.open(False) 2023-02-24T02:17:42,606 result = session.execute_query_statement("SELECT * FROM root.*") 2023-02-24T02:17:42,607 # Transform to Pandas Dataset 2023-02-24T02:17:42,607 df = result.todf() 2023-02-24T02:17:42,607 session.close() 2023-02-24T02:17:42,608 # Now you can work with the dataframe 2023-02-24T02:17:42,608 df = ... 2023-02-24T02:17:42,609 ``` 2023-02-24T02:17:42,610 ### IoTDB Testcontainer 2023-02-24T02:17:42,610 The Test Support is based on the lib `testcontainers` (https://testcontainers-python.readthedocs.io/en/latest/index.html) which you need to install in your project if you want to use the feature. 2023-02-24T02:17:42,611 To start (and stop) an IoTDB Database in a Docker container simply do: 2023-02-24T02:17:42,612 ```python 2023-02-24T02:17:42,612 class MyTestCase(unittest.TestCase): 2023-02-24T02:17:42,613 def test_something(self): 2023-02-24T02:17:42,613 with IoTDBContainer() as c: 2023-02-24T02:17:42,613 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2023-02-24T02:17:42,614 session.open(False) 2023-02-24T02:17:42,614 result = session.execute_query_statement("SHOW TIMESERIES") 2023-02-24T02:17:42,614 print(result) 2023-02-24T02:17:42,615 session.close() 2023-02-24T02:17:42,615 ``` 2023-02-24T02:17:42,616 by default it will load the image `apache/iotdb:latest`, if you want a specific version just pass it like e.g. `IoTDBContainer("apache/iotdb:0.12.0")` to get version `0.12.0` running. 2023-02-24T02:17:42,617 ### IoTDB DBAPI 2023-02-24T02:17:42,617 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2023-02-24T02:17:42,618 interface for accessing databases in Python. 2023-02-24T02:17:42,618 #### Examples 2023-02-24T02:17:42,619 + Initialization 2023-02-24T02:17:42,619 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2023-02-24T02:17:42,620 ```python 2023-02-24T02:17:42,620 from iotdb.dbapi import connect 2023-02-24T02:17:42,621 ip = "127.0.0.1" 2023-02-24T02:17:42,621 port_ = "6667" 2023-02-24T02:17:42,621 username_ = "root" 2023-02-24T02:17:42,622 password_ = "root" 2023-02-24T02:17:42,622 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2023-02-24T02:17:42,622 cursor = conn.cursor() 2023-02-24T02:17:42,622 ``` 2023-02-24T02:17:42,623 + simple SQL statement execution 2023-02-24T02:17:42,623 ```python 2023-02-24T02:17:42,623 cursor.execute("SELECT * FROM root.*") 2023-02-24T02:17:42,624 for row in cursor.fetchall(): 2023-02-24T02:17:42,624 print(row) 2023-02-24T02:17:42,624 ``` 2023-02-24T02:17:42,625 + execute SQL with parameter 2023-02-24T02:17:42,626 IoTDB DBAPI supports pyformat style parameters 2023-02-24T02:17:42,626 ```python 2023-02-24T02:17:42,626 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2023-02-24T02:17:42,627 for row in cursor.fetchall(): 2023-02-24T02:17:42,627 print(row) 2023-02-24T02:17:42,627 ``` 2023-02-24T02:17:42,628 + execute SQL with parameter sequences 2023-02-24T02:17:42,628 ```python 2023-02-24T02:17:42,629 seq_of_parameters = [ 2023-02-24T02:17:42,629 {"timestamp": 1, "temperature": 1}, 2023-02-24T02:17:42,629 {"timestamp": 2, "temperature": 2}, 2023-02-24T02:17:42,630 {"timestamp": 3, "temperature": 3}, 2023-02-24T02:17:42,630 {"timestamp": 4, "temperature": 4}, 2023-02-24T02:17:42,631 {"timestamp": 5, "temperature": 5}, 2023-02-24T02:17:42,631 ] 2023-02-24T02:17:42,631 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2023-02-24T02:17:42,632 cursor.executemany(sql,seq_of_parameters) 2023-02-24T02:17:42,632 ``` 2023-02-24T02:17:42,633 + close the connection and cursor 2023-02-24T02:17:42,633 ```python 2023-02-24T02:17:42,633 cursor.close() 2023-02-24T02:17:42,634 conn.close() 2023-02-24T02:17:42,634 ``` 2023-02-24T02:17:42,635 ### IoTDB SQLAlchemy Dialect (Experimental) 2023-02-24T02:17:42,635 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2023-02-24T02:17:42,635 This part is still being improved. 2023-02-24T02:17:42,636 Please do not use it in the production environment! 2023-02-24T02:17:42,636 #### Mapping of the metadata 2023-02-24T02:17:42,636 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2023-02-24T02:17:42,637 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2023-02-24T02:17:42,637 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2023-02-24T02:17:42,637 Converting the data model of IoTDB into the data model of SQLAlchemy. 2023-02-24T02:17:42,638 The metadata in the IoTDB are: 2023-02-24T02:17:42,639 1. Database 2023-02-24T02:17:42,639 2. Path 2023-02-24T02:17:42,639 3. Entity 2023-02-24T02:17:42,640 4. Measurement 2023-02-24T02:17:42,640 The metadata in the SQLAlchemy are: 2023-02-24T02:17:42,641 1. Schema 2023-02-24T02:17:42,641 2. Table 2023-02-24T02:17:42,641 3. Column 2023-02-24T02:17:42,642 The mapping relationship between them is: 2023-02-24T02:17:42,642 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2023-02-24T02:17:42,643 | -------------------- | ---------------------------------------------- | 2023-02-24T02:17:42,643 | Schema | Database | 2023-02-24T02:17:42,644 | Table | Path ( from database to entity ) + Entity | 2023-02-24T02:17:42,644 | Column | Measurement | 2023-02-24T02:17:42,645 The following figure shows the relationship between the two more intuitively: 2023-02-24T02:17:42,645 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2023-02-24T02:17:42,646 #### Data type mapping 2023-02-24T02:17:42,646 | data type in IoTDB | data type in SQLAlchemy | 2023-02-24T02:17:42,647 |--------------------|-------------------------| 2023-02-24T02:17:42,647 | BOOLEAN | Boolean | 2023-02-24T02:17:42,647 | INT32 | Integer | 2023-02-24T02:17:42,648 | INT64 | BigInteger | 2023-02-24T02:17:42,648 | FLOAT | Float | 2023-02-24T02:17:42,648 | DOUBLE | Float | 2023-02-24T02:17:42,649 | TEXT | Text | 2023-02-24T02:17:42,649 | LONG | BigInteger | 2023-02-24T02:17:42,649 #### Example 2023-02-24T02:17:42,650 + execute statement 2023-02-24T02:17:42,650 ```python 2023-02-24T02:17:42,651 from sqlalchemy import create_engine 2023-02-24T02:17:42,652 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-02-24T02:17:42,652 connect = engine.connect() 2023-02-24T02:17:42,652 result = connect.execute("SELECT ** FROM root") 2023-02-24T02:17:42,652 for row in result.fetchall(): 2023-02-24T02:17:42,653 print(row) 2023-02-24T02:17:42,653 ``` 2023-02-24T02:17:42,654 + ORM (now only simple queries are supported) 2023-02-24T02:17:42,654 ```python 2023-02-24T02:17:42,655 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2023-02-24T02:17:42,655 from sqlalchemy.ext.declarative import declarative_base 2023-02-24T02:17:42,655 from sqlalchemy.orm import sessionmaker 2023-02-24T02:17:42,656 metadata = MetaData( 2023-02-24T02:17:42,656 schema='root.factory' 2023-02-24T02:17:42,657 ) 2023-02-24T02:17:42,657 Base = declarative_base(metadata=metadata) 2023-02-24T02:17:42,658 class Device(Base): 2023-02-24T02:17:42,658 __tablename__ = "room2.device1" 2023-02-24T02:17:42,659 Time = Column(BigInteger, primary_key=True) 2023-02-24T02:17:42,659 temperature = Column(Float) 2023-02-24T02:17:42,660 status = Column(Float) 2023-02-24T02:17:42,661 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2023-02-24T02:17:42,661 DbSession = sessionmaker(bind=engine) 2023-02-24T02:17:42,662 session = DbSession() 2023-02-24T02:17:42,663 res = session.query(Device.status).filter(Device.temperature > 1) 2023-02-24T02:17:42,663 for row in res: 2023-02-24T02:17:42,664 print(row) 2023-02-24T02:17:42,664 ``` 2023-02-24T02:17:42,665 ## Developers 2023-02-24T02:17:42,665 ### Introduction 2023-02-24T02:17:42,666 This is an example of how to connect to IoTDB with python, using the thrift rpc interfaces. Things are almost the same on Windows or Linux, but pay attention to the difference like path separator. 2023-02-24T02:17:42,667 ### Prerequisites 2023-02-24T02:17:42,668 Python3.7 or later is preferred. 2023-02-24T02:17:42,668 You have to install Thrift (0.11.0 or later) to compile our thrift file into python code. Below is the official tutorial of installation, eventually, you should have a thrift executable. 2023-02-24T02:17:42,669 ``` 2023-02-24T02:17:42,669 http://thrift.apache.org/docs/install/ 2023-02-24T02:17:42,669 ``` 2023-02-24T02:17:42,670 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2023-02-24T02:17:42,670 ```shell 2023-02-24T02:17:42,671 pip install -r requirements_dev.txt 2023-02-24T02:17:42,671 ``` 2023-02-24T02:17:42,672 ### Compile the thrift library and Debug 2023-02-24T02:17:42,673 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2023-02-24T02:17:42,674 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2023-02-24T02:17:42,674 This folder is ignored from git and should **never be pushed to git!** 2023-02-24T02:17:42,675 **Notice** Do not upload `iotdb/thrift` to the git repo. 2023-02-24T02:17:42,677 ### Session Client & Example 2023-02-24T02:17:42,677 We packed up the Thrift interface in `client-py/src/iotdb/Session.py` (similar with its Java counterpart), also provided an example file `client-py/src/SessionExample.py` of how to use the session module. please read it carefully. 2023-02-24T02:17:42,679 Or, another simple example: 2023-02-24T02:17:42,679 ```python 2023-02-24T02:17:42,680 from iotdb.Session import Session 2023-02-24T02:17:42,680 ip = "127.0.0.1" 2023-02-24T02:17:42,681 port_ = "6667" 2023-02-24T02:17:42,681 username_ = "root" 2023-02-24T02:17:42,681 password_ = "root" 2023-02-24T02:17:42,682 session = Session(ip, port_, username_, password_) 2023-02-24T02:17:42,682 session.open(False) 2023-02-24T02:17:42,683 zone = session.get_time_zone() 2023-02-24T02:17:42,683 session.close() 2023-02-24T02:17:42,683 ``` 2023-02-24T02:17:42,684 ### Tests 2023-02-24T02:17:42,685 Please add your custom tests in `tests` folder. 2023-02-24T02:17:42,686 To run all defined tests just type `pytest .` in the root folder. 2023-02-24T02:17:42,687 **Notice** Some tests need docker to be started on your system as a test instance is started in a docker container using [testcontainers](https://testcontainers-python.readthedocs.io/en/latest/index.html). 2023-02-24T02:17:42,688 ### Futher Tools 2023-02-24T02:17:42,689 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2023-02-24T02:17:42,689 Both can be run by `black .` or `flake8 .` respectively. 2023-02-24T02:17:42,691 ## Releasing 2023-02-24T02:17:42,691 To do a release just ensure that you have the right set of generated thrift files. 2023-02-24T02:17:42,692 Then run linting and auto-formatting. 2023-02-24T02:17:42,692 Then, ensure that all tests work (via `pytest .`). 2023-02-24T02:17:42,692 Then you are good to go to do a release! 2023-02-24T02:17:42,694 ### Preparing your environment 2023-02-24T02:17:42,695 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2023-02-24T02:17:42,696 ### Doing the Release 2023-02-24T02:17:42,697 There is a convenient script `release.sh` to do all steps for a release. 2023-02-24T02:17:42,697 Namely, these are 2023-02-24T02:17:42,698 * Remove all transient directories from last release (if exists) 2023-02-24T02:17:42,698 * (Re-)generate all generated sources via mvn 2023-02-24T02:17:42,698 * Run Linting (flake8) 2023-02-24T02:17:42,699 * Run Tests via pytest 2023-02-24T02:17:42,699 * Build 2023-02-24T02:17:42,699 * Release to pypi 2023-02-24T02:17:42,903 running bdist_wheel 2023-02-24T02:17:42,981 running build 2023-02-24T02:17:42,982 running build_py 2023-02-24T02:17:43,000 creating build 2023-02-24T02:17:43,001 creating build/lib 2023-02-24T02:17:43,002 creating build/lib/tests 2023-02-24T02:17:43,005 copying tests/test_aligned_timeseries.py -> build/lib/tests 2023-02-24T02:17:43,009 copying tests/__init__.py -> build/lib/tests 2023-02-24T02:17:43,013 copying tests/test_todf.py -> build/lib/tests 2023-02-24T02:17:43,017 copying tests/test_dataframe.py -> build/lib/tests 2023-02-24T02:17:43,020 copying tests/test_delete_data.py -> build/lib/tests 2023-02-24T02:17:43,024 copying tests/test_one_device.py -> build/lib/tests 2023-02-24T02:17:43,028 copying tests/test_numpy_tablet.py -> build/lib/tests 2023-02-24T02:17:43,032 copying tests/test_tablet.py -> build/lib/tests 2023-02-24T02:17:43,036 copying tests/test_template.py -> build/lib/tests 2023-02-24T02:17:43,039 copying tests/tablet_performance_comparison.py -> build/lib/tests 2023-02-24T02:17:43,043 copying tests/test_session.py -> build/lib/tests 2023-02-24T02:17:43,049 creating build/lib/iotdb 2023-02-24T02:17:43,050 copying iotdb/__init__.py -> build/lib/iotdb 2023-02-24T02:17:43,054 copying iotdb/Session.py -> build/lib/iotdb 2023-02-24T02:17:43,061 copying iotdb/IoTDBContainer.py -> build/lib/iotdb 2023-02-24T02:17:43,066 creating build/lib/iotdb/utils 2023-02-24T02:17:43,067 copying iotdb/utils/RowRecord.py -> build/lib/iotdb/utils 2023-02-24T02:17:43,071 copying iotdb/utils/NumpyTablet.py -> build/lib/iotdb/utils 2023-02-24T02:17:43,075 copying iotdb/utils/Tablet.py -> build/lib/iotdb/utils 2023-02-24T02:17:43,079 copying iotdb/utils/IoTDBRpcDataSet.py -> build/lib/iotdb/utils 2023-02-24T02:17:43,084 copying iotdb/utils/IoTDBConstants.py -> build/lib/iotdb/utils 2023-02-24T02:17:43,087 copying iotdb/utils/__init__.py -> build/lib/iotdb/utils 2023-02-24T02:17:43,090 copying iotdb/utils/Field.py -> build/lib/iotdb/utils 2023-02-24T02:17:43,094 copying iotdb/utils/SessionDataSet.py -> build/lib/iotdb/utils 2023-02-24T02:17:43,098 copying iotdb/utils/BitMap.py -> build/lib/iotdb/utils 2023-02-24T02:17:43,103 creating build/lib/iotdb/thrift 2023-02-24T02:17:43,104 copying iotdb/thrift/__init__.py -> build/lib/iotdb/thrift 2023-02-24T02:17:43,109 creating build/lib/iotdb/template 2023-02-24T02:17:43,110 copying iotdb/template/InternalNode.py -> build/lib/iotdb/template 2023-02-24T02:17:43,114 copying iotdb/template/__init__.py -> build/lib/iotdb/template 2023-02-24T02:17:43,117 copying iotdb/template/TemplateQueryType.py -> build/lib/iotdb/template 2023-02-24T02:17:43,121 copying iotdb/template/Template.py -> build/lib/iotdb/template 2023-02-24T02:17:43,124 copying iotdb/template/MeasurementNode.py -> build/lib/iotdb/template 2023-02-24T02:17:43,128 copying iotdb/template/TemplateNode.py -> build/lib/iotdb/template 2023-02-24T02:17:43,133 creating build/lib/iotdb/sqlalchemy 2023-02-24T02:17:43,134 copying iotdb/sqlalchemy/IoTDBTypeCompiler.py -> build/lib/iotdb/sqlalchemy 2023-02-24T02:17:43,138 copying iotdb/sqlalchemy/__init__.py -> build/lib/iotdb/sqlalchemy 2023-02-24T02:17:43,141 copying iotdb/sqlalchemy/IoTDBSQLCompiler.py -> build/lib/iotdb/sqlalchemy 2023-02-24T02:17:43,145 copying iotdb/sqlalchemy/IoTDBIdentifierPreparer.py -> build/lib/iotdb/sqlalchemy 2023-02-24T02:17:43,149 copying iotdb/sqlalchemy/IoTDBDialect.py -> build/lib/iotdb/sqlalchemy 2023-02-24T02:17:43,154 creating build/lib/iotdb/dbapi 2023-02-24T02:17:43,155 copying iotdb/dbapi/Cursor.py -> build/lib/iotdb/dbapi 2023-02-24T02:17:43,160 copying iotdb/dbapi/Exceptions.py -> build/lib/iotdb/dbapi 2023-02-24T02:17:43,163 copying iotdb/dbapi/__init__.py -> build/lib/iotdb/dbapi 2023-02-24T02:17:43,166 copying iotdb/dbapi/Connection.py -> build/lib/iotdb/dbapi 2023-02-24T02:17:43,171 creating build/lib/iotdb/tsfile 2023-02-24T02:17:43,172 copying iotdb/tsfile/__init__.py -> build/lib/iotdb/tsfile 2023-02-24T02:17:43,177 creating build/lib/iotdb/thrift/common 2023-02-24T02:17:43,179 copying iotdb/thrift/common/ttypes.py -> build/lib/iotdb/thrift/common 2023-02-24T02:17:43,186 copying iotdb/thrift/common/__init__.py -> build/lib/iotdb/thrift/common 2023-02-24T02:17:43,189 copying iotdb/thrift/common/constants.py -> build/lib/iotdb/thrift/common 2023-02-24T02:17:43,193 creating build/lib/iotdb/thrift/rpc 2023-02-24T02:17:43,195 copying iotdb/thrift/rpc/ttypes.py -> build/lib/iotdb/thrift/rpc 2023-02-24T02:17:43,213 copying iotdb/thrift/rpc/__init__.py -> build/lib/iotdb/thrift/rpc 2023-02-24T02:17:43,216 copying iotdb/thrift/rpc/IClientRPCService.py -> build/lib/iotdb/thrift/rpc 2023-02-24T02:17:43,238 copying iotdb/thrift/rpc/constants.py -> build/lib/iotdb/thrift/rpc 2023-02-24T02:17:43,242 creating build/lib/iotdb/sqlalchemy/tests 2023-02-24T02:17:43,244 copying iotdb/sqlalchemy/tests/__init__.py -> build/lib/iotdb/sqlalchemy/tests 2023-02-24T02:17:43,247 copying iotdb/sqlalchemy/tests/test_dialect.py -> build/lib/iotdb/sqlalchemy/tests 2023-02-24T02:17:43,252 creating build/lib/iotdb/dbapi/tests 2023-02-24T02:17:43,254 copying iotdb/dbapi/tests/test_connection.py -> build/lib/iotdb/dbapi/tests 2023-02-24T02:17:43,257 copying iotdb/dbapi/tests/__init__.py -> build/lib/iotdb/dbapi/tests 2023-02-24T02:17:43,260 copying iotdb/dbapi/tests/test_cursor.py -> build/lib/iotdb/dbapi/tests 2023-02-24T02:17:43,265 creating build/lib/iotdb/tsfile/utils 2023-02-24T02:17:43,267 copying iotdb/tsfile/utils/__init__.py -> build/lib/iotdb/tsfile/utils 2023-02-24T02:17:43,270 copying iotdb/tsfile/utils/Pair.py -> build/lib/iotdb/tsfile/utils 2023-02-24T02:17:43,274 copying iotdb/tsfile/utils/ReadWriteIOUtils.py -> build/lib/iotdb/tsfile/utils 2023-02-24T02:17:43,278 creating build/lib/iotdb/tsfile/common 2023-02-24T02:17:43,280 copying iotdb/tsfile/common/__init__.py -> build/lib/iotdb/tsfile/common 2023-02-24T02:17:43,284 creating build/lib/iotdb/tsfile/common/constant 2023-02-24T02:17:43,286 copying iotdb/tsfile/common/constant/__init__.py -> build/lib/iotdb/tsfile/common/constant 2023-02-24T02:17:43,290 copying iotdb/tsfile/common/constant/TsFileConstant.py -> build/lib/iotdb/tsfile/common/constant 2023-02-24T02:17:43,349 installing to build/bdist.linux-armv7l/wheel 2023-02-24T02:17:43,350 running install 2023-02-24T02:17:43,410 running install_lib 2023-02-24T02:17:43,427 creating build/bdist.linux-armv7l 2023-02-24T02:17:43,428 creating build/bdist.linux-armv7l/wheel 2023-02-24T02:17:43,431 creating build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,433 copying build/lib/tests/test_aligned_timeseries.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,438 copying build/lib/tests/__init__.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,442 copying build/lib/tests/test_todf.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,446 copying build/lib/tests/test_dataframe.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,450 copying build/lib/tests/test_delete_data.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,455 copying build/lib/tests/test_one_device.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,459 copying build/lib/tests/test_numpy_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,463 copying build/lib/tests/test_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,468 copying build/lib/tests/test_template.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,472 copying build/lib/tests/tablet_performance_comparison.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,476 copying build/lib/tests/test_session.py -> build/bdist.linux-armv7l/wheel/tests 2023-02-24T02:17:43,482 creating build/bdist.linux-armv7l/wheel/iotdb 2023-02-24T02:17:43,485 creating build/bdist.linux-armv7l/wheel/iotdb/utils 2023-02-24T02:17:43,487 copying build/lib/iotdb/utils/RowRecord.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-02-24T02:17:43,491 copying build/lib/iotdb/utils/NumpyTablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-02-24T02:17:43,496 copying build/lib/iotdb/utils/Tablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-02-24T02:17:43,500 copying build/lib/iotdb/utils/IoTDBRpcDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-02-24T02:17:43,506 copying build/lib/iotdb/utils/IoTDBConstants.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-02-24T02:17:43,510 copying build/lib/iotdb/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-02-24T02:17:43,513 copying build/lib/iotdb/utils/Field.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-02-24T02:17:43,518 copying build/lib/iotdb/utils/SessionDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-02-24T02:17:43,523 copying build/lib/iotdb/utils/BitMap.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2023-02-24T02:17:43,526 copying build/lib/iotdb/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb 2023-02-24T02:17:43,530 copying build/lib/iotdb/Session.py -> build/bdist.linux-armv7l/wheel/iotdb 2023-02-24T02:17:43,539 creating build/bdist.linux-armv7l/wheel/iotdb/thrift 2023-02-24T02:17:43,541 copying build/lib/iotdb/thrift/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift 2023-02-24T02:17:43,545 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2023-02-24T02:17:43,547 copying build/lib/iotdb/thrift/common/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2023-02-24T02:17:43,554 copying build/lib/iotdb/thrift/common/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2023-02-24T02:17:43,558 copying build/lib/iotdb/thrift/common/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2023-02-24T02:17:43,562 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-02-24T02:17:43,564 copying build/lib/iotdb/thrift/rpc/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-02-24T02:17:43,582 copying build/lib/iotdb/thrift/rpc/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-02-24T02:17:43,586 copying build/lib/iotdb/thrift/rpc/IClientRPCService.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-02-24T02:17:43,607 copying build/lib/iotdb/thrift/rpc/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2023-02-24T02:17:43,611 creating build/bdist.linux-armv7l/wheel/iotdb/template 2023-02-24T02:17:43,613 copying build/lib/iotdb/template/InternalNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-02-24T02:17:43,617 copying build/lib/iotdb/template/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-02-24T02:17:43,620 copying build/lib/iotdb/template/TemplateQueryType.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-02-24T02:17:43,624 copying build/lib/iotdb/template/Template.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-02-24T02:17:43,627 copying build/lib/iotdb/template/MeasurementNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-02-24T02:17:43,631 copying build/lib/iotdb/template/TemplateNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2023-02-24T02:17:43,635 creating build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-02-24T02:17:43,638 creating build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2023-02-24T02:17:43,640 copying build/lib/iotdb/sqlalchemy/tests/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2023-02-24T02:17:43,644 copying build/lib/iotdb/sqlalchemy/tests/test_dialect.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2023-02-24T02:17:43,648 copying build/lib/iotdb/sqlalchemy/IoTDBTypeCompiler.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-02-24T02:17:43,651 copying build/lib/iotdb/sqlalchemy/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-02-24T02:17:43,655 copying build/lib/iotdb/sqlalchemy/IoTDBSQLCompiler.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-02-24T02:17:43,659 copying build/lib/iotdb/sqlalchemy/IoTDBIdentifierPreparer.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-02-24T02:17:43,663 copying build/lib/iotdb/sqlalchemy/IoTDBDialect.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2023-02-24T02:17:43,667 copying build/lib/iotdb/IoTDBContainer.py -> build/bdist.linux-armv7l/wheel/iotdb 2023-02-24T02:17:43,671 creating build/bdist.linux-armv7l/wheel/iotdb/dbapi 2023-02-24T02:17:43,674 creating build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2023-02-24T02:17:43,676 copying build/lib/iotdb/dbapi/tests/test_connection.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2023-02-24T02:17:43,680 copying build/lib/iotdb/dbapi/tests/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2023-02-24T02:17:43,683 copying build/lib/iotdb/dbapi/tests/test_cursor.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2023-02-24T02:17:43,687 copying build/lib/iotdb/dbapi/Cursor.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2023-02-24T02:17:43,691 copying build/lib/iotdb/dbapi/Exceptions.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2023-02-24T02:17:43,695 copying build/lib/iotdb/dbapi/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2023-02-24T02:17:43,699 copying build/lib/iotdb/dbapi/Connection.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2023-02-24T02:17:43,703 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile 2023-02-24T02:17:43,706 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2023-02-24T02:17:43,708 copying build/lib/iotdb/tsfile/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2023-02-24T02:17:43,712 copying build/lib/iotdb/tsfile/utils/Pair.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2023-02-24T02:17:43,716 copying build/lib/iotdb/tsfile/utils/ReadWriteIOUtils.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2023-02-24T02:17:43,720 copying build/lib/iotdb/tsfile/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile 2023-02-24T02:17:43,725 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/common 2023-02-24T02:17:43,728 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2023-02-24T02:17:43,729 copying build/lib/iotdb/tsfile/common/constant/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2023-02-24T02:17:43,733 copying build/lib/iotdb/tsfile/common/constant/TsFileConstant.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2023-02-24T02:17:43,737 copying build/lib/iotdb/tsfile/common/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common 2023-02-24T02:17:43,740 running install_egg_info 2023-02-24T02:17:43,795 running egg_info 2023-02-24T02:17:43,806 writing apache_iotdb.egg-info/PKG-INFO 2023-02-24T02:17:43,810 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2023-02-24T02:17:43,814 writing entry points to apache_iotdb.egg-info/entry_points.txt 2023-02-24T02:17:43,816 writing requirements to apache_iotdb.egg-info/requires.txt 2023-02-24T02:17:43,819 writing top-level names to apache_iotdb.egg-info/top_level.txt 2023-02-24T02:17:43,856 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-02-24T02:17:43,863 adding license file 'LICENSE' 2023-02-24T02:17:43,876 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2023-02-24T02:17:43,879 Copying apache_iotdb.egg-info to build/bdist.linux-armv7l/wheel/apache_iotdb-1.0.1-py3.7.egg-info 2023-02-24T02:17:43,903 running install_scripts 2023-02-24T02:17:43,952 creating build/bdist.linux-armv7l/wheel/apache_iotdb-1.0.1.dist-info/WHEEL 2023-02-24T02:17:43,958 creating '/tmp/pip-wheel-c959qupx/.tmp-zi1409ag/apache_iotdb-1.0.1-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2023-02-24T02:17:43,966 adding 'iotdb/IoTDBContainer.py' 2023-02-24T02:17:43,981 adding 'iotdb/Session.py' 2023-02-24T02:17:43,985 adding 'iotdb/__init__.py' 2023-02-24T02:17:43,989 adding 'iotdb/dbapi/Connection.py' 2023-02-24T02:17:43,992 adding 'iotdb/dbapi/Cursor.py' 2023-02-24T02:17:43,995 adding 'iotdb/dbapi/Exceptions.py' 2023-02-24T02:17:43,998 adding 'iotdb/dbapi/__init__.py' 2023-02-24T02:17:44,001 adding 'iotdb/dbapi/tests/__init__.py' 2023-02-24T02:17:44,004 adding 'iotdb/dbapi/tests/test_connection.py' 2023-02-24T02:17:44,007 adding 'iotdb/dbapi/tests/test_cursor.py' 2023-02-24T02:17:44,012 adding 'iotdb/sqlalchemy/IoTDBDialect.py' 2023-02-24T02:17:44,014 adding 'iotdb/sqlalchemy/IoTDBIdentifierPreparer.py' 2023-02-24T02:17:44,018 adding 'iotdb/sqlalchemy/IoTDBSQLCompiler.py' 2023-02-24T02:17:44,021 adding 'iotdb/sqlalchemy/IoTDBTypeCompiler.py' 2023-02-24T02:17:44,023 adding 'iotdb/sqlalchemy/__init__.py' 2023-02-24T02:17:44,027 adding 'iotdb/sqlalchemy/tests/__init__.py' 2023-02-24T02:17:44,030 adding 'iotdb/sqlalchemy/tests/test_dialect.py' 2023-02-24T02:17:44,034 adding 'iotdb/template/InternalNode.py' 2023-02-24T02:17:44,036 adding 'iotdb/template/MeasurementNode.py' 2023-02-24T02:17:44,039 adding 'iotdb/template/Template.py' 2023-02-24T02:17:44,042 adding 'iotdb/template/TemplateNode.py' 2023-02-24T02:17:44,045 adding 'iotdb/template/TemplateQueryType.py' 2023-02-24T02:17:44,047 adding 'iotdb/template/__init__.py' 2023-02-24T02:17:44,051 adding 'iotdb/thrift/__init__.py' 2023-02-24T02:17:44,054 adding 'iotdb/thrift/common/__init__.py' 2023-02-24T02:17:44,056 adding 'iotdb/thrift/common/constants.py' 2023-02-24T02:17:44,064 adding 'iotdb/thrift/common/ttypes.py' 2023-02-24T02:17:44,096 adding 'iotdb/thrift/rpc/IClientRPCService.py' 2023-02-24T02:17:44,106 adding 'iotdb/thrift/rpc/__init__.py' 2023-02-24T02:17:44,109 adding 'iotdb/thrift/rpc/constants.py' 2023-02-24T02:17:44,138 adding 'iotdb/thrift/rpc/ttypes.py' 2023-02-24T02:17:44,147 adding 'iotdb/tsfile/__init__.py' 2023-02-24T02:17:44,150 adding 'iotdb/tsfile/common/__init__.py' 2023-02-24T02:17:44,154 adding 'iotdb/tsfile/common/constant/TsFileConstant.py' 2023-02-24T02:17:44,157 adding 'iotdb/tsfile/common/constant/__init__.py' 2023-02-24T02:17:44,160 adding 'iotdb/tsfile/utils/Pair.py' 2023-02-24T02:17:44,163 adding 'iotdb/tsfile/utils/ReadWriteIOUtils.py' 2023-02-24T02:17:44,165 adding 'iotdb/tsfile/utils/__init__.py' 2023-02-24T02:17:44,170 adding 'iotdb/utils/BitMap.py' 2023-02-24T02:17:44,173 adding 'iotdb/utils/Field.py' 2023-02-24T02:17:44,175 adding 'iotdb/utils/IoTDBConstants.py' 2023-02-24T02:17:44,181 adding 'iotdb/utils/IoTDBRpcDataSet.py' 2023-02-24T02:17:44,185 adding 'iotdb/utils/NumpyTablet.py' 2023-02-24T02:17:44,187 adding 'iotdb/utils/RowRecord.py' 2023-02-24T02:17:44,191 adding 'iotdb/utils/SessionDataSet.py' 2023-02-24T02:17:44,194 adding 'iotdb/utils/Tablet.py' 2023-02-24T02:17:44,197 adding 'iotdb/utils/__init__.py' 2023-02-24T02:17:44,201 adding 'tests/__init__.py' 2023-02-24T02:17:44,205 adding 'tests/tablet_performance_comparison.py' 2023-02-24T02:17:44,209 adding 'tests/test_aligned_timeseries.py' 2023-02-24T02:17:44,212 adding 'tests/test_dataframe.py' 2023-02-24T02:17:44,215 adding 'tests/test_delete_data.py' 2023-02-24T02:17:44,219 adding 'tests/test_numpy_tablet.py' 2023-02-24T02:17:44,222 adding 'tests/test_one_device.py' 2023-02-24T02:17:44,226 adding 'tests/test_session.py' 2023-02-24T02:17:44,229 adding 'tests/test_tablet.py' 2023-02-24T02:17:44,232 adding 'tests/test_template.py' 2023-02-24T02:17:44,235 adding 'tests/test_todf.py' 2023-02-24T02:17:44,241 adding 'apache_iotdb-1.0.1.dist-info/LICENSE' 2023-02-24T02:17:44,247 adding 'apache_iotdb-1.0.1.dist-info/METADATA' 2023-02-24T02:17:44,250 adding 'apache_iotdb-1.0.1.dist-info/WHEEL' 2023-02-24T02:17:44,252 adding 'apache_iotdb-1.0.1.dist-info/entry_points.txt' 2023-02-24T02:17:44,253 adding 'apache_iotdb-1.0.1.dist-info/top_level.txt' 2023-02-24T02:17:44,257 adding 'apache_iotdb-1.0.1.dist-info/RECORD' 2023-02-24T02:17:44,265 removing build/bdist.linux-armv7l/wheel 2023-02-24T02:17:44,312 /tmp/pip-build-env-d0tm1w99/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'website' 2023-02-24T02:17:44,313 warnings.warn(msg) 2023-02-24T02:17:44,460 Building wheel for apache-iotdb (pyproject.toml): finished with status 'done' 2023-02-24T02:17:44,479 Created wheel for apache-iotdb: filename=apache_iotdb-1.0.1-py3-none-any.whl size=119759 sha256=9fc3d243ca97c88bd3ca1f5092686e3ab5c99a6e5206fd6a6c6fdaab15c796b6 2023-02-24T02:17:44,481 Stored in directory: /tmp/pip-ephem-wheel-cache-q1h8q0gn/wheels/b9/c9/9a/3f3ad2dbcef59a49d93e0fadc8e985199c111a4bc0c4b5e222 2023-02-24T02:17:44,521 Successfully built apache-iotdb 2023-02-24T02:17:44,536 Removed build tracker: '/tmp/pip-build-tracker-86ik_8ez'