2024-07-16T04:17:20,398 Created temporary directory: /tmp/pip-build-tracker-zljf12zd 2024-07-16T04:17:20,400 Initialized build tracking at /tmp/pip-build-tracker-zljf12zd 2024-07-16T04:17:20,400 Created build tracker: /tmp/pip-build-tracker-zljf12zd 2024-07-16T04:17:20,400 Entered build tracker: /tmp/pip-build-tracker-zljf12zd 2024-07-16T04:17:20,401 Created temporary directory: /tmp/pip-wheel-ehdf5cvi 2024-07-16T04:17:20,405 Created temporary directory: /tmp/pip-ephem-wheel-cache-02uvxzat 2024-07-16T04:17:20,429 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2024-07-16T04:17:20,432 2 location(s) to search for versions of apache-iotdb: 2024-07-16T04:17:20,432 * https://pypi.org/simple/apache-iotdb/ 2024-07-16T04:17:20,432 * https://www.piwheels.org/simple/apache-iotdb/ 2024-07-16T04:17:20,433 Fetching project page and analyzing links: https://pypi.org/simple/apache-iotdb/ 2024-07-16T04:17:20,433 Getting page https://pypi.org/simple/apache-iotdb/ 2024-07-16T04:17:20,435 Found index url https://pypi.org/simple/ 2024-07-16T04:17:20,486 Fetched page https://pypi.org/simple/apache-iotdb/ as application/vnd.pypi.simple.v1+json 2024-07-16T04:17:20,499 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 2024-07-16T04:17:20,500 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) 2024-07-16T04:17:20,500 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 2024-07-16T04:17:20,501 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) 2024-07-16T04:17:20,501 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 2024-07-16T04:17:20,502 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) 2024-07-16T04:17:20,502 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 2024-07-16T04:17:20,502 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) 2024-07-16T04:17:20,503 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 2024-07-16T04:17:20,503 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) 2024-07-16T04:17:20,504 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 2024-07-16T04:17:20,504 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) 2024-07-16T04:17:20,505 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 2024-07-16T04:17:20,505 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) 2024-07-16T04:17:20,505 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 2024-07-16T04:17:20,506 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) 2024-07-16T04:17:20,506 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 2024-07-16T04:17:20,506 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) 2024-07-16T04:17:20,507 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 2024-07-16T04:17:20,507 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) 2024-07-16T04:17:20,508 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 2024-07-16T04:17:20,508 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) 2024-07-16T04:17:20,508 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 2024-07-16T04:17:20,509 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) 2024-07-16T04:17:20,509 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 2024-07-16T04:17:20,510 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) 2024-07-16T04:17:20,510 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 2024-07-16T04:17:20,510 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) 2024-07-16T04:17:20,511 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 2024-07-16T04:17:20,511 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) 2024-07-16T04:17:20,512 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 2024-07-16T04:17:20,512 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) 2024-07-16T04:17:20,512 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 2024-07-16T04:17:20,513 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) 2024-07-16T04:17:20,513 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 2024-07-16T04:17:20,513 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) 2024-07-16T04:17:20,514 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 2024-07-16T04:17:20,514 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) 2024-07-16T04:17:20,515 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 2024-07-16T04:17:20,515 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) 2024-07-16T04:17:20,516 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 2024-07-16T04:17:20,516 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) 2024-07-16T04:17:20,516 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 2024-07-16T04:17:20,517 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) 2024-07-16T04:17:20,517 Found link https://files.pythonhosted.org/packages/42/eb/3d7ac8d794238b75997ff3f55db6e02436bfa558a8df4ea21e58bf8db6fd/apache-iotdb-0.13.5.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.5 2024-07-16T04:17:20,517 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/51/a3/9117edfd3d72a1d338b7cff8060e672dd7b39dfeb2ca0d6c22db51bf9b90/apache_iotdb-0.13.5-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,518 Found link https://files.pythonhosted.org/packages/95/c9/5d7a22003e57fe3c1637928926a73d11815830ee63c62f2cefeaa8eed28f/apache-iotdb-0.13.5.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 0.13.5.1 2024-07-16T04:17:20,518 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/89/0a/816b8a85f6be9f8fe3534f79ea12341dad900b59ba0ac126835640a09db0/apache_iotdb-0.13.5.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,519 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 2024-07-16T04:17:20,519 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) 2024-07-16T04:17:20,519 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 2024-07-16T04:17:20,520 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) 2024-07-16T04:17:20,520 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 2024-07-16T04:17:20,520 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) 2024-07-16T04:17:20,521 Found link https://files.pythonhosted.org/packages/15/99/bf0d6eae0c005a4dcc88068be36ea3e5b4dcb26e50b6698b4bd814d052e9/apache-iotdb-1.1.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.1.0 2024-07-16T04:17:20,521 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/3b/cd/72bfb3f3f3684bfe0c054dfd8c34fdb8a85f7572a6ec27b7a6ff99127516/apache_iotdb-1.1.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,522 Found link https://files.pythonhosted.org/packages/51/36/6e73e46e1d6b2d2272a5a1b369da16dd36a3120aa883ea86d2a9a85ce105/apache-iotdb-1.1.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.1.2 2024-07-16T04:17:20,522 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/74/d6/3ad8c98fc4321ba99120a231634801b6bf1eea9520e5aa5d153b6fab6f61/apache_iotdb-1.1.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,522 Found link https://files.pythonhosted.org/packages/49/bb/4a9f741d7ff483481ee9db619807e8835bcdd590eb9893de33ed091f7ec7/apache-iotdb-1.2.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.2.0 2024-07-16T04:17:20,523 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/93/b9/84d2d8e158ef2d5317f4f6ce0f14be616ec2b93c090fbf06a84e41d1cedd/apache_iotdb-1.2.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,523 Found link https://files.pythonhosted.org/packages/86/cd/f88e673287faf21660046a1ec14dc917a5e598f2145ea2f1da0767dae759/apache-iotdb-1.2.1.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.2.1 2024-07-16T04:17:20,523 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/c6/a6/8f5f10ad95e5a2c2f54c78011ff2848a7b96860a439eeecdf136c3364795/apache_iotdb-1.2.1-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,524 Found link https://files.pythonhosted.org/packages/98/0a/a5c8bede42a5dcf2f2eadb8b37a406a1ff2fb4e4f78df149d7a63cac058f/apache-iotdb-1.3.0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.3.0 2024-07-16T04:17:20,524 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/f3/83/1292d28c772d573c1c2d191a1bcec031c5ee48fc0e0549ab6e0046142519/apache_iotdb-1.3.0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,524 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/26/90/04aecfda0e2d3c93e53aa00bbb92417391cde2e83f97877a3c9dc5d0d34d/apache_iotdb-1.3.2-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,525 Found link https://files.pythonhosted.org/packages/f1/c0/65f0577b9ac8a25c69937d15666909fe23d5656715feb060270e0c14ee85/apache_iotdb-1.3.2.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.3.2 2024-07-16T04:17:20,525 Skipping link: No binaries permitted for apache-iotdb: https://files.pythonhosted.org/packages/9e/5c/e41b2e1725d91ad7bfd6cc234f0f73df0b02ed202d6b9529be0637685b26/apache_iotdb-1.3.2.post0-py3-none-any.whl (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,526 Found link https://files.pythonhosted.org/packages/da/d1/4895eca705f20d7a1158771ac25b72703b3a72893ba543c706a9fd286636/apache_iotdb-1.3.2.post0.tar.gz (from https://pypi.org/simple/apache-iotdb/) (requires-python:>=3.7), version: 1.3.2.post0 2024-07-16T04:17:20,526 Fetching project page and analyzing links: https://www.piwheels.org/simple/apache-iotdb/ 2024-07-16T04:17:20,527 Getting page https://www.piwheels.org/simple/apache-iotdb/ 2024-07-16T04:17:20,528 Found index url https://www.piwheels.org/simple/ 2024-07-16T04:17:20,596 Fetched page https://www.piwheels.org/simple/apache-iotdb/ as text/html 2024-07-16T04:17:20,606 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.3.2-py3-none-any.whl#sha256=f4e7d294537025b4289e392f2d81ea300ebb94715af85eb1ce9b451d024b6243 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,606 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.3.0-py3-none-any.whl#sha256=ca1a253e48a497e1827121b7ceaf6a1bbebfc2add7c7932550384d3c424d4276 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,606 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.2.1-py3-none-any.whl#sha256=23c4b520884e408c124527f709ba7d5c14e606dec0ea24e8a8ff33d2098c849a (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,606 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.2.0-py3-none-any.whl#sha256=e6253fd0619e108f72e54769a1fdec7500f43db062b603e1bed07ebb989698b2 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,607 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.1.2-py3-none-any.whl#sha256=47e1ea2a866155bd45db05471a074cd1b4bede6e798d2b6a63e218767c92ae12 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,607 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.1.0-py3-none-any.whl#sha256=17b0261e5e0602df730baf1bdd055750c850a2fd0163d2ce09d0083dfcf169f4 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,607 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-1.0.1-py3-none-any.whl#sha256=9fc3d243ca97c88bd3ca1f5092686e3ab5c99a6e5206fd6a6c6fdaab15c796b6 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,607 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) 2024-07-16T04:17:20,607 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) 2024-07-16T04:17:20,608 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.5.1-py3-none-any.whl#sha256=43316f1302a0f1a08a1842964fb611e34f317e908b76d1872954c09f2c5f5919 (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,608 Skipping link: No binaries permitted for apache-iotdb: https://www.piwheels.org/simple/apache-iotdb/apache_iotdb-0.13.5-py3-none-any.whl#sha256=e25dac25664b9ff8313cbb697f634269ef857ec9217d3256b893c43c8b0c151f (from https://www.piwheels.org/simple/apache-iotdb/) (requires-python:>=3.7) 2024-07-16T04:17:20,608 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) 2024-07-16T04:17:20,608 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) 2024-07-16T04:17:20,608 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) 2024-07-16T04:17:20,609 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) 2024-07-16T04:17:20,609 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) 2024-07-16T04:17:20,609 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) 2024-07-16T04:17:20,609 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) 2024-07-16T04:17:20,609 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) 2024-07-16T04:17:20,610 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) 2024-07-16T04:17:20,610 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) 2024-07-16T04:17:20,610 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) 2024-07-16T04:17:20,610 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) 2024-07-16T04:17:20,610 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) 2024-07-16T04:17:20,610 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) 2024-07-16T04:17:20,611 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) 2024-07-16T04:17:20,611 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) 2024-07-16T04:17:20,611 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) 2024-07-16T04:17:20,611 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) 2024-07-16T04:17:20,611 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) 2024-07-16T04:17:20,612 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) 2024-07-16T04:17:20,612 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) 2024-07-16T04:17:20,612 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) 2024-07-16T04:17:20,612 Skipping link: not a file: https://www.piwheels.org/simple/apache-iotdb/ 2024-07-16T04:17:20,612 Skipping link: not a file: https://pypi.org/simple/apache-iotdb/ 2024-07-16T04:17:20,635 Given no hashes to check 1 links for project 'apache-iotdb': discarding no candidates 2024-07-16T04:17:20,652 Collecting apache-iotdb==1.3.2.post0 2024-07-16T04:17:20,654 Created temporary directory: /tmp/pip-unpack-02sdpdyh 2024-07-16T04:17:20,696 Downloading apache_iotdb-1.3.2.post0.tar.gz (89 kB) 2024-07-16T04:17:20,891 Added apache-iotdb==1.3.2.post0 from https://files.pythonhosted.org/packages/da/d1/4895eca705f20d7a1158771ac25b72703b3a72893ba543c706a9fd286636/apache_iotdb-1.3.2.post0.tar.gz to build tracker '/tmp/pip-build-tracker-zljf12zd' 2024-07-16T04:17:20,895 Created temporary directory: /tmp/pip-build-env-heqw98yx 2024-07-16T04:17:20,905 Installing build dependencies: started 2024-07-16T04:17:20,906 Running command pip subprocess to install build dependencies 2024-07-16T04:17:22,064 Using pip 24.0 from /usr/local/lib/python3.9/dist-packages/pip (python 3.9) 2024-07-16T04:17:22,579 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple 2024-07-16T04:17:24,072 Collecting setuptools>=40.8.0 2024-07-16T04:17:24,088 Using cached https://www.piwheels.org/simple/setuptools/setuptools-70.3.0-py3-none-any.whl (931 kB) 2024-07-16T04:17:25,815 Installing collected packages: setuptools 2024-07-16T04:17:28,228 Successfully installed setuptools-70.3.0 2024-07-16T04:17:28,407 [notice] A new release of pip is available: 24.0 -> 24.1.2 2024-07-16T04:17:28,407 [notice] To update, run: python3 -m pip install --upgrade pip 2024-07-16T04:17:28,669 Installing build dependencies: finished with status 'done' 2024-07-16T04:17:28,674 Getting requirements to build wheel: started 2024-07-16T04:17:28,675 Running command Getting requirements to build wheel 2024-07-16T04:17:29,190 2024-07-16T04:17:29,193 # Apache IoTDB 2024-07-16T04:17:29,194 [![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) 2024-07-16T04:17:29,194 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2024-07-16T04:17:29,194 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2024-07-16T04:17:29,194 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2024-07-16T04:17:29,194 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2024-07-16T04:17:29,194 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2024-07-16T04:17:29,194 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2024-07-16T04:17:29,195 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2024-07-16T04:17:29,195 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2024-07-16T04:17:29,195 architecture, high performance and rich feature set together with its deep integration with 2024-07-16T04:17:29,195 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2024-07-16T04:17:29,195 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2024-07-16T04:17:29,195 ## Python Native API 2024-07-16T04:17:29,196 ### Requirements 2024-07-16T04:17:29,196 You have to install thrift (>=0.13) before using the package. 2024-07-16T04:17:29,197 ### How to use (Example) 2024-07-16T04:17:29,197 First, download the latest package: `pip3 install apache-iotdb` 2024-07-16T04:17:29,197 *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!* 2024-07-16T04:17:29,197 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) 2024-07-16T04:17:29,198 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2024-07-16T04:17:29,198 (you need to add `import iotdb` in the head of the file) 2024-07-16T04:17:29,198 Or: 2024-07-16T04:17:29,198 ```python 2024-07-16T04:17:29,198 from iotdb.Session import Session 2024-07-16T04:17:29,199 ip = "127.0.0.1" 2024-07-16T04:17:29,199 port_ = "6667" 2024-07-16T04:17:29,199 username_ = "root" 2024-07-16T04:17:29,199 password_ = "root" 2024-07-16T04:17:29,199 session = Session(ip, port_, username_, password_) 2024-07-16T04:17:29,199 session.open(False) 2024-07-16T04:17:29,200 zone = session.get_time_zone() 2024-07-16T04:17:29,200 session.close() 2024-07-16T04:17:29,200 ``` 2024-07-16T04:17:29,200 ### Initialization 2024-07-16T04:17:29,200 * Initialize a Session 2024-07-16T04:17:29,201 ```python 2024-07-16T04:17:29,201 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2024-07-16T04:17:29,201 ``` 2024-07-16T04:17:29,201 * Open a session, with a parameter to specify whether to enable RPC compression 2024-07-16T04:17:29,201 ```python 2024-07-16T04:17:29,202 session.open(enable_rpc_compression=False) 2024-07-16T04:17:29,202 ``` 2024-07-16T04:17:29,202 Notice: this RPC compression status of client must comply with that of IoTDB server 2024-07-16T04:17:29,202 * Close a Session 2024-07-16T04:17:29,202 ```python 2024-07-16T04:17:29,203 session.close() 2024-07-16T04:17:29,203 ``` 2024-07-16T04:17:29,203 ### Data Definition Interface (DDL Interface) 2024-07-16T04:17:29,203 #### DATABASE Management 2024-07-16T04:17:29,204 * CREATE DATABASE 2024-07-16T04:17:29,204 ```python 2024-07-16T04:17:29,204 session.set_storage_group(group_name) 2024-07-16T04:17:29,204 ``` 2024-07-16T04:17:29,204 * Delete one or several databases 2024-07-16T04:17:29,205 ```python 2024-07-16T04:17:29,205 session.delete_storage_group(group_name) 2024-07-16T04:17:29,205 session.delete_storage_groups(group_name_lst) 2024-07-16T04:17:29,205 ``` 2024-07-16T04:17:29,205 #### Timeseries Management 2024-07-16T04:17:29,205 * Create one or multiple timeseries 2024-07-16T04:17:29,206 ```python 2024-07-16T04:17:29,206 session.create_time_series(ts_path, data_type, encoding, compressor, 2024-07-16T04:17:29,206 props=None, tags=None, attributes=None, alias=None) 2024-07-16T04:17:29,206 session.create_multi_time_series( 2024-07-16T04:17:29,206 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2024-07-16T04:17:29,207 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2024-07-16T04:17:29,207 ) 2024-07-16T04:17:29,207 ``` 2024-07-16T04:17:29,207 * Create aligned timeseries 2024-07-16T04:17:29,207 ```python 2024-07-16T04:17:29,207 session.create_aligned_time_series( 2024-07-16T04:17:29,208 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2024-07-16T04:17:29,208 ) 2024-07-16T04:17:29,208 ``` 2024-07-16T04:17:29,208 Attention: Alias of measurements are **not supported** currently. 2024-07-16T04:17:29,208 * Delete one or several timeseries 2024-07-16T04:17:29,209 ```python 2024-07-16T04:17:29,209 session.delete_time_series(paths_list) 2024-07-16T04:17:29,209 ``` 2024-07-16T04:17:29,209 * Check whether the specific timeseries exists 2024-07-16T04:17:29,209 ```python 2024-07-16T04:17:29,210 session.check_time_series_exists(path) 2024-07-16T04:17:29,210 ``` 2024-07-16T04:17:29,210 ### Data Manipulation Interface (DML Interface) 2024-07-16T04:17:29,210 #### Insert 2024-07-16T04:17:29,211 It is recommended to use insertTablet to help improve write efficiency. 2024-07-16T04:17:29,211 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2024-07-16T04:17:29,211 * **Better Write Performance** 2024-07-16T04:17:29,211 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2024-07-16T04:17:29,211 We have two implementations of Tablet in Python API. 2024-07-16T04:17:29,212 * Normal Tablet 2024-07-16T04:17:29,212 ```python 2024-07-16T04:17:29,212 values_ = [ 2024-07-16T04:17:29,212 [False, 10, 11, 1.1, 10011.1, "test01"], 2024-07-16T04:17:29,212 [True, 100, 11111, 1.25, 101.0, "test02"], 2024-07-16T04:17:29,212 [False, 100, 1, 188.1, 688.25, "test03"], 2024-07-16T04:17:29,212 [True, 0, 0, 0, 6.25, "test04"], 2024-07-16T04:17:29,213 ] 2024-07-16T04:17:29,213 timestamps_ = [1, 2, 3, 4] 2024-07-16T04:17:29,213 tablet_ = Tablet( 2024-07-16T04:17:29,213 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-16T04:17:29,213 ) 2024-07-16T04:17:29,213 session.insert_tablet(tablet_) 2024-07-16T04:17:29,213 values_ = [ 2024-07-16T04:17:29,214 [None, 10, 11, 1.1, 10011.1, "test01"], 2024-07-16T04:17:29,214 [True, None, 11111, 1.25, 101.0, "test02"], 2024-07-16T04:17:29,214 [False, 100, None, 188.1, 688.25, "test03"], 2024-07-16T04:17:29,214 [True, 0, 0, 0, None, None], 2024-07-16T04:17:29,214 ] 2024-07-16T04:17:29,214 timestamps_ = [16, 17, 18, 19] 2024-07-16T04:17:29,214 tablet_ = Tablet( 2024-07-16T04:17:29,215 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-16T04:17:29,215 ) 2024-07-16T04:17:29,215 session.insert_tablet(tablet_) 2024-07-16T04:17:29,215 ``` 2024-07-16T04:17:29,215 * Numpy Tablet 2024-07-16T04:17:29,215 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2024-07-16T04:17:29,215 With less memory footprint and time cost of serialization, the insert performance will be better. 2024-07-16T04:17:29,216 **Notice** 2024-07-16T04:17:29,216 1. time and value columns in Tablet are ndarray. 2024-07-16T04:17:29,216 2. recommended to use the specific dtypes to each ndarray, see the example below 2024-07-16T04:17:29,216 (if not, the default dtypes are also ok). 2024-07-16T04:17:29,216 ```python 2024-07-16T04:17:29,216 import numpy as np 2024-07-16T04:17:29,217 data_types_ = [ 2024-07-16T04:17:29,217 TSDataType.BOOLEAN, 2024-07-16T04:17:29,217 TSDataType.INT32, 2024-07-16T04:17:29,217 TSDataType.INT64, 2024-07-16T04:17:29,217 TSDataType.FLOAT, 2024-07-16T04:17:29,217 TSDataType.DOUBLE, 2024-07-16T04:17:29,217 TSDataType.TEXT, 2024-07-16T04:17:29,217 ] 2024-07-16T04:17:29,217 np_values_ = [ 2024-07-16T04:17:29,218 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-16T04:17:29,218 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-16T04:17:29,218 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-16T04:17:29,218 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-16T04:17:29,218 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-16T04:17:29,218 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-16T04:17:29,218 ] 2024-07-16T04:17:29,218 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2024-07-16T04:17:29,219 np_tablet_ = NumpyTablet( 2024-07-16T04:17:29,219 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2024-07-16T04:17:29,219 ) 2024-07-16T04:17:29,219 session.insert_tablet(np_tablet_) 2024-07-16T04:17:29,219 # insert one numpy tablet with none into the database. 2024-07-16T04:17:29,219 np_values_ = [ 2024-07-16T04:17:29,219 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-16T04:17:29,219 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-16T04:17:29,220 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-16T04:17:29,220 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-16T04:17:29,220 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-16T04:17:29,220 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-16T04:17:29,220 ] 2024-07-16T04:17:29,220 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2024-07-16T04:17:29,220 np_bitmaps_ = [] 2024-07-16T04:17:29,220 for i in range(len(measurements_)): 2024-07-16T04:17:29,221 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2024-07-16T04:17:29,221 np_bitmaps_[0].mark(0) 2024-07-16T04:17:29,221 np_bitmaps_[1].mark(1) 2024-07-16T04:17:29,221 np_bitmaps_[2].mark(2) 2024-07-16T04:17:29,221 np_bitmaps_[4].mark(3) 2024-07-16T04:17:29,221 np_bitmaps_[5].mark(3) 2024-07-16T04:17:29,221 np_tablet_with_none = NumpyTablet( 2024-07-16T04:17:29,221 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2024-07-16T04:17:29,222 ) 2024-07-16T04:17:29,222 session.insert_tablet(np_tablet_with_none) 2024-07-16T04:17:29,222 ``` 2024-07-16T04:17:29,222 * Insert multiple Tablets 2024-07-16T04:17:29,222 ```python 2024-07-16T04:17:29,222 session.insert_tablets(tablet_lst) 2024-07-16T04:17:29,223 ``` 2024-07-16T04:17:29,223 * Insert a Record 2024-07-16T04:17:29,223 ```python 2024-07-16T04:17:29,223 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2024-07-16T04:17:29,223 ``` 2024-07-16T04:17:29,224 * Insert multiple Records 2024-07-16T04:17:29,224 ```python 2024-07-16T04:17:29,224 session.insert_records( 2024-07-16T04:17:29,224 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2024-07-16T04:17:29,224 ) 2024-07-16T04:17:29,225 ``` 2024-07-16T04:17:29,225 * Insert multiple Records that belong to the same device. 2024-07-16T04:17:29,225 With type info the server has no need to do type inference, which leads a better performance 2024-07-16T04:17:29,225 ```python 2024-07-16T04:17:29,226 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2024-07-16T04:17:29,226 ``` 2024-07-16T04:17:29,226 #### Insert with type inference 2024-07-16T04:17:29,226 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. 2024-07-16T04:17:29,226 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2024-07-16T04:17:29,227 ```python 2024-07-16T04:17:29,227 session.insert_str_record(device_id, timestamp, measurements, string_values) 2024-07-16T04:17:29,227 ``` 2024-07-16T04:17:29,227 #### Insert of Aligned Timeseries 2024-07-16T04:17:29,227 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2024-07-16T04:17:29,227 * insert_aligned_record 2024-07-16T04:17:29,228 * insert_aligned_records 2024-07-16T04:17:29,228 * insert_aligned_records_of_one_device 2024-07-16T04:17:29,228 * insert_aligned_tablet 2024-07-16T04:17:29,228 * insert_aligned_tablets 2024-07-16T04:17:29,228 ### IoTDB-SQL Interface 2024-07-16T04:17:29,229 * Execute query statement 2024-07-16T04:17:29,229 ```python 2024-07-16T04:17:29,229 session.execute_query_statement(sql) 2024-07-16T04:17:29,229 ``` 2024-07-16T04:17:29,229 * Execute non query statement 2024-07-16T04:17:29,230 ```python 2024-07-16T04:17:29,230 session.execute_non_query_statement(sql) 2024-07-16T04:17:29,230 ``` 2024-07-16T04:17:29,230 * Execute statement 2024-07-16T04:17:29,230 ```python 2024-07-16T04:17:29,230 session.execute_statement(sql) 2024-07-16T04:17:29,231 ``` 2024-07-16T04:17:29,231 ### Device Template 2024-07-16T04:17:29,231 #### Create Device Template 2024-07-16T04:17:29,231 The step for creating a metadata template is as follows 2024-07-16T04:17:29,231 1. Create the template class 2024-07-16T04:17:29,231 2. Adding child Node,InternalNode and MeasurementNode can be chose 2024-07-16T04:17:29,231 3. Execute create device template function 2024-07-16T04:17:29,232 ```python 2024-07-16T04:17:29,232 template = Template(name=template_name, share_time=True) 2024-07-16T04:17:29,232 i_node_gps = InternalNode(name="GPS", share_time=False) 2024-07-16T04:17:29,232 i_node_v = InternalNode(name="vehicle", share_time=True) 2024-07-16T04:17:29,232 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2024-07-16T04:17:29,232 i_node_gps.add_child(m_node_x) 2024-07-16T04:17:29,233 i_node_v.add_child(m_node_x) 2024-07-16T04:17:29,233 template.add_template(i_node_gps) 2024-07-16T04:17:29,233 template.add_template(i_node_v) 2024-07-16T04:17:29,233 template.add_template(m_node_x) 2024-07-16T04:17:29,233 session.create_schema_template(template) 2024-07-16T04:17:29,234 ``` 2024-07-16T04:17:29,234 #### Modify Device Template nodes 2024-07-16T04:17:29,234 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2024-07-16T04:17:29,234 * add node in template 2024-07-16T04:17:29,234 ```python 2024-07-16T04:17:29,234 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2024-07-16T04:17:29,234 ``` 2024-07-16T04:17:29,235 * delete node in template 2024-07-16T04:17:29,235 ```python 2024-07-16T04:17:29,235 session.delete_node_in_template(template_name, path) 2024-07-16T04:17:29,235 ``` 2024-07-16T04:17:29,235 #### Set Device Template 2024-07-16T04:17:29,235 ```python 2024-07-16T04:17:29,235 session.set_schema_template(template_name, prefix_path) 2024-07-16T04:17:29,236 ``` 2024-07-16T04:17:29,236 #### Uset Device Template 2024-07-16T04:17:29,236 ```python 2024-07-16T04:17:29,236 session.unset_schema_template(template_name, prefix_path) 2024-07-16T04:17:29,236 ``` 2024-07-16T04:17:29,236 #### Show Device Template 2024-07-16T04:17:29,236 * Show all device templates 2024-07-16T04:17:29,237 ```python 2024-07-16T04:17:29,237 session.show_all_templates() 2024-07-16T04:17:29,237 ``` 2024-07-16T04:17:29,237 * Count all nodes in templates 2024-07-16T04:17:29,237 ```python 2024-07-16T04:17:29,237 session.count_measurements_in_template(template_name) 2024-07-16T04:17:29,237 ``` 2024-07-16T04:17:29,238 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2024-07-16T04:17:29,238 ```python 2024-07-16T04:17:29,238 session.count_measurements_in_template(template_name, path) 2024-07-16T04:17:29,238 ``` 2024-07-16T04:17:29,238 * Judge whether the path is exist or not in templates, This path may not belong to the template 2024-07-16T04:17:29,238 ```python 2024-07-16T04:17:29,238 session.is_path_exist_in_template(template_name, path) 2024-07-16T04:17:29,238 ``` 2024-07-16T04:17:29,239 * Show nodes under in device template 2024-07-16T04:17:29,239 ```python 2024-07-16T04:17:29,239 session.show_measurements_in_template(template_name) 2024-07-16T04:17:29,239 ``` 2024-07-16T04:17:29,239 * Show the path prefix where a device template is set 2024-07-16T04:17:29,239 ```python 2024-07-16T04:17:29,239 session.show_paths_template_set_on(template_name) 2024-07-16T04:17:29,240 ``` 2024-07-16T04:17:29,240 * Show the path prefix where a device template is used (i.e. the time series has been created) 2024-07-16T04:17:29,240 ```python 2024-07-16T04:17:29,240 session.show_paths_template_using_on(template_name) 2024-07-16T04:17:29,240 ``` 2024-07-16T04:17:29,240 #### Drop Device Template 2024-07-16T04:17:29,241 Delete an existing metadata template,dropping an already set template is not supported 2024-07-16T04:17:29,241 ```python 2024-07-16T04:17:29,241 session.drop_schema_template("template_python") 2024-07-16T04:17:29,241 ``` 2024-07-16T04:17:29,241 ### Pandas Support 2024-07-16T04:17:29,242 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2024-07-16T04:17:29,242 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2024-07-16T04:17:29,242 Example: 2024-07-16T04:17:29,242 ```python 2024-07-16T04:17:29,242 from iotdb.Session import Session 2024-07-16T04:17:29,242 ip = "127.0.0.1" 2024-07-16T04:17:29,243 port_ = "6667" 2024-07-16T04:17:29,243 username_ = "root" 2024-07-16T04:17:29,243 password_ = "root" 2024-07-16T04:17:29,243 session = Session(ip, port_, username_, password_) 2024-07-16T04:17:29,243 session.open(False) 2024-07-16T04:17:29,243 result = session.execute_query_statement("SELECT * FROM root.*") 2024-07-16T04:17:29,243 # Transform to Pandas Dataset 2024-07-16T04:17:29,244 df = result.todf() 2024-07-16T04:17:29,244 session.close() 2024-07-16T04:17:29,244 # Now you can work with the dataframe 2024-07-16T04:17:29,244 df = ... 2024-07-16T04:17:29,244 ``` 2024-07-16T04:17:29,245 ### IoTDB Testcontainer 2024-07-16T04:17:29,245 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. 2024-07-16T04:17:29,245 To start (and stop) an IoTDB Database in a Docker container simply do: 2024-07-16T04:17:29,245 ```python 2024-07-16T04:17:29,246 class MyTestCase(unittest.TestCase): 2024-07-16T04:17:29,246 def test_something(self): 2024-07-16T04:17:29,246 with IoTDBContainer() as c: 2024-07-16T04:17:29,246 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2024-07-16T04:17:29,246 session.open(False) 2024-07-16T04:17:29,246 result = session.execute_query_statement("SHOW TIMESERIES") 2024-07-16T04:17:29,246 print(result) 2024-07-16T04:17:29,247 session.close() 2024-07-16T04:17:29,247 ``` 2024-07-16T04:17:29,247 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. 2024-07-16T04:17:29,247 ### IoTDB DBAPI 2024-07-16T04:17:29,248 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2024-07-16T04:17:29,248 interface for accessing databases in Python. 2024-07-16T04:17:29,248 #### Examples 2024-07-16T04:17:29,248 + Initialization 2024-07-16T04:17:29,248 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2024-07-16T04:17:29,248 ```python 2024-07-16T04:17:29,248 from iotdb.dbapi import connect 2024-07-16T04:17:29,249 ip = "127.0.0.1" 2024-07-16T04:17:29,249 port_ = "6667" 2024-07-16T04:17:29,249 username_ = "root" 2024-07-16T04:17:29,249 password_ = "root" 2024-07-16T04:17:29,249 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2024-07-16T04:17:29,249 cursor = conn.cursor() 2024-07-16T04:17:29,249 ``` 2024-07-16T04:17:29,250 + simple SQL statement execution 2024-07-16T04:17:29,250 ```python 2024-07-16T04:17:29,250 cursor.execute("SELECT * FROM root.*") 2024-07-16T04:17:29,250 for row in cursor.fetchall(): 2024-07-16T04:17:29,250 print(row) 2024-07-16T04:17:29,250 ``` 2024-07-16T04:17:29,250 + execute SQL with parameter 2024-07-16T04:17:29,251 IoTDB DBAPI supports pyformat style parameters 2024-07-16T04:17:29,251 ```python 2024-07-16T04:17:29,251 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2024-07-16T04:17:29,251 for row in cursor.fetchall(): 2024-07-16T04:17:29,251 print(row) 2024-07-16T04:17:29,251 ``` 2024-07-16T04:17:29,252 + execute SQL with parameter sequences 2024-07-16T04:17:29,252 ```python 2024-07-16T04:17:29,252 seq_of_parameters = [ 2024-07-16T04:17:29,252 {"timestamp": 1, "temperature": 1}, 2024-07-16T04:17:29,252 {"timestamp": 2, "temperature": 2}, 2024-07-16T04:17:29,252 {"timestamp": 3, "temperature": 3}, 2024-07-16T04:17:29,252 {"timestamp": 4, "temperature": 4}, 2024-07-16T04:17:29,253 {"timestamp": 5, "temperature": 5}, 2024-07-16T04:17:29,253 ] 2024-07-16T04:17:29,253 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2024-07-16T04:17:29,253 cursor.executemany(sql,seq_of_parameters) 2024-07-16T04:17:29,253 ``` 2024-07-16T04:17:29,253 + close the connection and cursor 2024-07-16T04:17:29,254 ```python 2024-07-16T04:17:29,254 cursor.close() 2024-07-16T04:17:29,254 conn.close() 2024-07-16T04:17:29,254 ``` 2024-07-16T04:17:29,254 ### IoTDB SQLAlchemy Dialect (Experimental) 2024-07-16T04:17:29,254 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2024-07-16T04:17:29,254 This part is still being improved. 2024-07-16T04:17:29,255 Please do not use it in the production environment! 2024-07-16T04:17:29,255 #### Mapping of the metadata 2024-07-16T04:17:29,255 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2024-07-16T04:17:29,255 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2024-07-16T04:17:29,255 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2024-07-16T04:17:29,255 Converting the data model of IoTDB into the data model of SQLAlchemy. 2024-07-16T04:17:29,256 The metadata in the IoTDB are: 2024-07-16T04:17:29,256 1. Database 2024-07-16T04:17:29,256 2. Path 2024-07-16T04:17:29,256 3. Entity 2024-07-16T04:17:29,256 4. Measurement 2024-07-16T04:17:29,256 The metadata in the SQLAlchemy are: 2024-07-16T04:17:29,257 1. Schema 2024-07-16T04:17:29,257 2. Table 2024-07-16T04:17:29,257 3. Column 2024-07-16T04:17:29,257 The mapping relationship between them is: 2024-07-16T04:17:29,257 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2024-07-16T04:17:29,258 | -------------------- | ---------------------------------------------- | 2024-07-16T04:17:29,258 | Schema | Database | 2024-07-16T04:17:29,258 | Table | Path ( from database to entity ) + Entity | 2024-07-16T04:17:29,258 | Column | Measurement | 2024-07-16T04:17:29,258 The following figure shows the relationship between the two more intuitively: 2024-07-16T04:17:29,258 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2024-07-16T04:17:29,259 #### Data type mapping 2024-07-16T04:17:29,259 | data type in IoTDB | data type in SQLAlchemy | 2024-07-16T04:17:29,259 |--------------------|-------------------------| 2024-07-16T04:17:29,259 | BOOLEAN | Boolean | 2024-07-16T04:17:29,259 | INT32 | Integer | 2024-07-16T04:17:29,259 | INT64 | BigInteger | 2024-07-16T04:17:29,259 | FLOAT | Float | 2024-07-16T04:17:29,260 | DOUBLE | Float | 2024-07-16T04:17:29,260 | TEXT | Text | 2024-07-16T04:17:29,260 | LONG | BigInteger | 2024-07-16T04:17:29,260 #### Example 2024-07-16T04:17:29,260 + execute statement 2024-07-16T04:17:29,260 ```python 2024-07-16T04:17:29,260 from sqlalchemy import create_engine 2024-07-16T04:17:29,261 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-16T04:17:29,261 connect = engine.connect() 2024-07-16T04:17:29,261 result = connect.execute("SELECT ** FROM root") 2024-07-16T04:17:29,261 for row in result.fetchall(): 2024-07-16T04:17:29,261 print(row) 2024-07-16T04:17:29,261 ``` 2024-07-16T04:17:29,261 + ORM (now only simple queries are supported) 2024-07-16T04:17:29,262 ```python 2024-07-16T04:17:29,262 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2024-07-16T04:17:29,262 from sqlalchemy.ext.declarative import declarative_base 2024-07-16T04:17:29,262 from sqlalchemy.orm import sessionmaker 2024-07-16T04:17:29,262 metadata = MetaData( 2024-07-16T04:17:29,262 schema='root.factory' 2024-07-16T04:17:29,262 ) 2024-07-16T04:17:29,263 Base = declarative_base(metadata=metadata) 2024-07-16T04:17:29,263 class Device(Base): 2024-07-16T04:17:29,263 __tablename__ = "room2.device1" 2024-07-16T04:17:29,263 Time = Column(BigInteger, primary_key=True) 2024-07-16T04:17:29,263 temperature = Column(Float) 2024-07-16T04:17:29,263 status = Column(Float) 2024-07-16T04:17:29,264 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-16T04:17:29,264 DbSession = sessionmaker(bind=engine) 2024-07-16T04:17:29,264 session = DbSession() 2024-07-16T04:17:29,264 res = session.query(Device.status).filter(Device.temperature > 1) 2024-07-16T04:17:29,265 for row in res: 2024-07-16T04:17:29,265 print(row) 2024-07-16T04:17:29,265 ``` 2024-07-16T04:17:29,265 ## Developers 2024-07-16T04:17:29,266 ### Introduction 2024-07-16T04:17:29,266 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. 2024-07-16T04:17:29,266 ### Prerequisites 2024-07-16T04:17:29,267 Python3.7 or later is preferred. 2024-07-16T04:17:29,267 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. 2024-07-16T04:17:29,267 ``` 2024-07-16T04:17:29,267 http://thrift.apache.org/docs/install/ 2024-07-16T04:17:29,267 ``` 2024-07-16T04:17:29,268 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2024-07-16T04:17:29,268 ```shell 2024-07-16T04:17:29,268 pip install -r requirements_dev.txt 2024-07-16T04:17:29,268 ``` 2024-07-16T04:17:29,268 ### Compile the thrift library and Debug 2024-07-16T04:17:29,269 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2024-07-16T04:17:29,269 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2024-07-16T04:17:29,269 This folder is ignored from git and should **never be pushed to git!** 2024-07-16T04:17:29,269 **Notice** Do not upload `iotdb/thrift` to the git repo. 2024-07-16T04:17:29,270 ### Session Client & Example 2024-07-16T04:17:29,270 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. 2024-07-16T04:17:29,270 Or, another simple example: 2024-07-16T04:17:29,271 ```python 2024-07-16T04:17:29,271 from iotdb.Session import Session 2024-07-16T04:17:29,271 ip = "127.0.0.1" 2024-07-16T04:17:29,271 port_ = "6667" 2024-07-16T04:17:29,271 username_ = "root" 2024-07-16T04:17:29,271 password_ = "root" 2024-07-16T04:17:29,272 session = Session(ip, port_, username_, password_) 2024-07-16T04:17:29,272 session.open(False) 2024-07-16T04:17:29,272 zone = session.get_time_zone() 2024-07-16T04:17:29,272 session.close() 2024-07-16T04:17:29,272 ``` 2024-07-16T04:17:29,273 ### Tests 2024-07-16T04:17:29,273 Please add your custom tests in `tests` folder. 2024-07-16T04:17:29,273 To run all defined tests just type `pytest .` in the root folder. 2024-07-16T04:17:29,273 **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). 2024-07-16T04:17:29,274 ### Futher Tools 2024-07-16T04:17:29,274 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2024-07-16T04:17:29,274 Both can be run by `black .` or `flake8 .` respectively. 2024-07-16T04:17:29,275 ## Releasing 2024-07-16T04:17:29,275 To do a release just ensure that you have the right set of generated thrift files. 2024-07-16T04:17:29,275 Then run linting and auto-formatting. 2024-07-16T04:17:29,275 Then, ensure that all tests work (via `pytest .`). 2024-07-16T04:17:29,275 Then you are good to go to do a release! 2024-07-16T04:17:29,276 ### Preparing your environment 2024-07-16T04:17:29,276 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2024-07-16T04:17:29,277 ### Doing the Release 2024-07-16T04:17:29,277 There is a convenient script `release.sh` to do all steps for a release. 2024-07-16T04:17:29,277 Namely, these are 2024-07-16T04:17:29,278 * Remove all transient directories from last release (if exists) 2024-07-16T04:17:29,278 * (Re-)generate all generated sources via mvn 2024-07-16T04:17:29,278 * Run Linting (flake8) 2024-07-16T04:17:29,278 * Run Tests via pytest 2024-07-16T04:17:29,278 * Build 2024-07-16T04:17:29,278 * Release to pypi 2024-07-16T04:17:29,279 /tmp/pip-build-env-heqw98yx/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'website' 2024-07-16T04:17:29,279 warnings.warn(msg) 2024-07-16T04:17:29,287 running egg_info 2024-07-16T04:17:29,292 writing apache_iotdb.egg-info/PKG-INFO 2024-07-16T04:17:29,296 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2024-07-16T04:17:29,298 writing entry points to apache_iotdb.egg-info/entry_points.txt 2024-07-16T04:17:29,299 writing requirements to apache_iotdb.egg-info/requires.txt 2024-07-16T04:17:29,300 writing top-level names to apache_iotdb.egg-info/top_level.txt 2024-07-16T04:17:29,338 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-07-16T04:17:29,346 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-07-16T04:17:29,416 Getting requirements to build wheel: finished with status 'done' 2024-07-16T04:17:29,420 Created temporary directory: /tmp/pip-modern-metadata-oqugj4s1 2024-07-16T04:17:29,422 Preparing metadata (pyproject.toml): started 2024-07-16T04:17:29,423 Running command Preparing metadata (pyproject.toml) 2024-07-16T04:17:29,922 2024-07-16T04:17:29,925 # Apache IoTDB 2024-07-16T04:17:29,926 [![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) 2024-07-16T04:17:29,926 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2024-07-16T04:17:29,926 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2024-07-16T04:17:29,926 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2024-07-16T04:17:29,926 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2024-07-16T04:17:29,926 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2024-07-16T04:17:29,926 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2024-07-16T04:17:29,927 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2024-07-16T04:17:29,927 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2024-07-16T04:17:29,927 architecture, high performance and rich feature set together with its deep integration with 2024-07-16T04:17:29,927 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2024-07-16T04:17:29,927 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2024-07-16T04:17:29,928 ## Python Native API 2024-07-16T04:17:29,928 ### Requirements 2024-07-16T04:17:29,928 You have to install thrift (>=0.13) before using the package. 2024-07-16T04:17:29,929 ### How to use (Example) 2024-07-16T04:17:29,929 First, download the latest package: `pip3 install apache-iotdb` 2024-07-16T04:17:29,929 *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!* 2024-07-16T04:17:29,929 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) 2024-07-16T04:17:29,930 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2024-07-16T04:17:29,930 (you need to add `import iotdb` in the head of the file) 2024-07-16T04:17:29,930 Or: 2024-07-16T04:17:29,930 ```python 2024-07-16T04:17:29,931 from iotdb.Session import Session 2024-07-16T04:17:29,931 ip = "127.0.0.1" 2024-07-16T04:17:29,931 port_ = "6667" 2024-07-16T04:17:29,931 username_ = "root" 2024-07-16T04:17:29,931 password_ = "root" 2024-07-16T04:17:29,931 session = Session(ip, port_, username_, password_) 2024-07-16T04:17:29,932 session.open(False) 2024-07-16T04:17:29,932 zone = session.get_time_zone() 2024-07-16T04:17:29,932 session.close() 2024-07-16T04:17:29,932 ``` 2024-07-16T04:17:29,932 ### Initialization 2024-07-16T04:17:29,932 * Initialize a Session 2024-07-16T04:17:29,933 ```python 2024-07-16T04:17:29,933 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2024-07-16T04:17:29,933 ``` 2024-07-16T04:17:29,933 * Open a session, with a parameter to specify whether to enable RPC compression 2024-07-16T04:17:29,933 ```python 2024-07-16T04:17:29,934 session.open(enable_rpc_compression=False) 2024-07-16T04:17:29,934 ``` 2024-07-16T04:17:29,934 Notice: this RPC compression status of client must comply with that of IoTDB server 2024-07-16T04:17:29,934 * Close a Session 2024-07-16T04:17:29,935 ```python 2024-07-16T04:17:29,935 session.close() 2024-07-16T04:17:29,935 ``` 2024-07-16T04:17:29,935 ### Data Definition Interface (DDL Interface) 2024-07-16T04:17:29,935 #### DATABASE Management 2024-07-16T04:17:29,935 * CREATE DATABASE 2024-07-16T04:17:29,936 ```python 2024-07-16T04:17:29,936 session.set_storage_group(group_name) 2024-07-16T04:17:29,936 ``` 2024-07-16T04:17:29,936 * Delete one or several databases 2024-07-16T04:17:29,936 ```python 2024-07-16T04:17:29,937 session.delete_storage_group(group_name) 2024-07-16T04:17:29,937 session.delete_storage_groups(group_name_lst) 2024-07-16T04:17:29,937 ``` 2024-07-16T04:17:29,937 #### Timeseries Management 2024-07-16T04:17:29,937 * Create one or multiple timeseries 2024-07-16T04:17:29,937 ```python 2024-07-16T04:17:29,938 session.create_time_series(ts_path, data_type, encoding, compressor, 2024-07-16T04:17:29,938 props=None, tags=None, attributes=None, alias=None) 2024-07-16T04:17:29,938 session.create_multi_time_series( 2024-07-16T04:17:29,938 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2024-07-16T04:17:29,938 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2024-07-16T04:17:29,938 ) 2024-07-16T04:17:29,938 ``` 2024-07-16T04:17:29,939 * Create aligned timeseries 2024-07-16T04:17:29,939 ```python 2024-07-16T04:17:29,939 session.create_aligned_time_series( 2024-07-16T04:17:29,939 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2024-07-16T04:17:29,939 ) 2024-07-16T04:17:29,940 ``` 2024-07-16T04:17:29,940 Attention: Alias of measurements are **not supported** currently. 2024-07-16T04:17:29,940 * Delete one or several timeseries 2024-07-16T04:17:29,940 ```python 2024-07-16T04:17:29,940 session.delete_time_series(paths_list) 2024-07-16T04:17:29,940 ``` 2024-07-16T04:17:29,941 * Check whether the specific timeseries exists 2024-07-16T04:17:29,941 ```python 2024-07-16T04:17:29,941 session.check_time_series_exists(path) 2024-07-16T04:17:29,941 ``` 2024-07-16T04:17:29,941 ### Data Manipulation Interface (DML Interface) 2024-07-16T04:17:29,942 #### Insert 2024-07-16T04:17:29,942 It is recommended to use insertTablet to help improve write efficiency. 2024-07-16T04:17:29,942 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2024-07-16T04:17:29,942 * **Better Write Performance** 2024-07-16T04:17:29,942 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2024-07-16T04:17:29,943 We have two implementations of Tablet in Python API. 2024-07-16T04:17:29,943 * Normal Tablet 2024-07-16T04:17:29,943 ```python 2024-07-16T04:17:29,943 values_ = [ 2024-07-16T04:17:29,943 [False, 10, 11, 1.1, 10011.1, "test01"], 2024-07-16T04:17:29,944 [True, 100, 11111, 1.25, 101.0, "test02"], 2024-07-16T04:17:29,944 [False, 100, 1, 188.1, 688.25, "test03"], 2024-07-16T04:17:29,944 [True, 0, 0, 0, 6.25, "test04"], 2024-07-16T04:17:29,944 ] 2024-07-16T04:17:29,944 timestamps_ = [1, 2, 3, 4] 2024-07-16T04:17:29,944 tablet_ = Tablet( 2024-07-16T04:17:29,944 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-16T04:17:29,945 ) 2024-07-16T04:17:29,945 session.insert_tablet(tablet_) 2024-07-16T04:17:29,945 values_ = [ 2024-07-16T04:17:29,945 [None, 10, 11, 1.1, 10011.1, "test01"], 2024-07-16T04:17:29,945 [True, None, 11111, 1.25, 101.0, "test02"], 2024-07-16T04:17:29,945 [False, 100, None, 188.1, 688.25, "test03"], 2024-07-16T04:17:29,945 [True, 0, 0, 0, None, None], 2024-07-16T04:17:29,946 ] 2024-07-16T04:17:29,946 timestamps_ = [16, 17, 18, 19] 2024-07-16T04:17:29,946 tablet_ = Tablet( 2024-07-16T04:17:29,946 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-16T04:17:29,946 ) 2024-07-16T04:17:29,946 session.insert_tablet(tablet_) 2024-07-16T04:17:29,946 ``` 2024-07-16T04:17:29,946 * Numpy Tablet 2024-07-16T04:17:29,947 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2024-07-16T04:17:29,947 With less memory footprint and time cost of serialization, the insert performance will be better. 2024-07-16T04:17:29,947 **Notice** 2024-07-16T04:17:29,947 1. time and value columns in Tablet are ndarray. 2024-07-16T04:17:29,947 2. recommended to use the specific dtypes to each ndarray, see the example below 2024-07-16T04:17:29,947 (if not, the default dtypes are also ok). 2024-07-16T04:17:29,947 ```python 2024-07-16T04:17:29,948 import numpy as np 2024-07-16T04:17:29,948 data_types_ = [ 2024-07-16T04:17:29,948 TSDataType.BOOLEAN, 2024-07-16T04:17:29,948 TSDataType.INT32, 2024-07-16T04:17:29,948 TSDataType.INT64, 2024-07-16T04:17:29,948 TSDataType.FLOAT, 2024-07-16T04:17:29,948 TSDataType.DOUBLE, 2024-07-16T04:17:29,948 TSDataType.TEXT, 2024-07-16T04:17:29,948 ] 2024-07-16T04:17:29,949 np_values_ = [ 2024-07-16T04:17:29,949 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-16T04:17:29,949 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-16T04:17:29,949 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-16T04:17:29,949 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-16T04:17:29,949 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-16T04:17:29,949 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-16T04:17:29,949 ] 2024-07-16T04:17:29,950 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2024-07-16T04:17:29,950 np_tablet_ = NumpyTablet( 2024-07-16T04:17:29,950 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2024-07-16T04:17:29,950 ) 2024-07-16T04:17:29,950 session.insert_tablet(np_tablet_) 2024-07-16T04:17:29,950 # insert one numpy tablet with none into the database. 2024-07-16T04:17:29,950 np_values_ = [ 2024-07-16T04:17:29,950 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-16T04:17:29,951 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-16T04:17:29,951 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-16T04:17:29,951 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-16T04:17:29,951 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-16T04:17:29,951 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-16T04:17:29,951 ] 2024-07-16T04:17:29,951 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2024-07-16T04:17:29,951 np_bitmaps_ = [] 2024-07-16T04:17:29,952 for i in range(len(measurements_)): 2024-07-16T04:17:29,952 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2024-07-16T04:17:29,952 np_bitmaps_[0].mark(0) 2024-07-16T04:17:29,952 np_bitmaps_[1].mark(1) 2024-07-16T04:17:29,952 np_bitmaps_[2].mark(2) 2024-07-16T04:17:29,952 np_bitmaps_[4].mark(3) 2024-07-16T04:17:29,952 np_bitmaps_[5].mark(3) 2024-07-16T04:17:29,952 np_tablet_with_none = NumpyTablet( 2024-07-16T04:17:29,952 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2024-07-16T04:17:29,953 ) 2024-07-16T04:17:29,953 session.insert_tablet(np_tablet_with_none) 2024-07-16T04:17:29,953 ``` 2024-07-16T04:17:29,953 * Insert multiple Tablets 2024-07-16T04:17:29,953 ```python 2024-07-16T04:17:29,953 session.insert_tablets(tablet_lst) 2024-07-16T04:17:29,954 ``` 2024-07-16T04:17:29,954 * Insert a Record 2024-07-16T04:17:29,954 ```python 2024-07-16T04:17:29,954 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2024-07-16T04:17:29,954 ``` 2024-07-16T04:17:29,955 * Insert multiple Records 2024-07-16T04:17:29,955 ```python 2024-07-16T04:17:29,955 session.insert_records( 2024-07-16T04:17:29,955 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2024-07-16T04:17:29,955 ) 2024-07-16T04:17:29,955 ``` 2024-07-16T04:17:29,956 * Insert multiple Records that belong to the same device. 2024-07-16T04:17:29,956 With type info the server has no need to do type inference, which leads a better performance 2024-07-16T04:17:29,956 ```python 2024-07-16T04:17:29,956 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2024-07-16T04:17:29,957 ``` 2024-07-16T04:17:29,957 #### Insert with type inference 2024-07-16T04:17:29,957 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. 2024-07-16T04:17:29,957 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2024-07-16T04:17:29,958 ```python 2024-07-16T04:17:29,958 session.insert_str_record(device_id, timestamp, measurements, string_values) 2024-07-16T04:17:29,958 ``` 2024-07-16T04:17:29,958 #### Insert of Aligned Timeseries 2024-07-16T04:17:29,958 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2024-07-16T04:17:29,958 * insert_aligned_record 2024-07-16T04:17:29,959 * insert_aligned_records 2024-07-16T04:17:29,959 * insert_aligned_records_of_one_device 2024-07-16T04:17:29,959 * insert_aligned_tablet 2024-07-16T04:17:29,959 * insert_aligned_tablets 2024-07-16T04:17:29,959 ### IoTDB-SQL Interface 2024-07-16T04:17:29,960 * Execute query statement 2024-07-16T04:17:29,960 ```python 2024-07-16T04:17:29,960 session.execute_query_statement(sql) 2024-07-16T04:17:29,960 ``` 2024-07-16T04:17:29,960 * Execute non query statement 2024-07-16T04:17:29,961 ```python 2024-07-16T04:17:29,961 session.execute_non_query_statement(sql) 2024-07-16T04:17:29,961 ``` 2024-07-16T04:17:29,961 * Execute statement 2024-07-16T04:17:29,961 ```python 2024-07-16T04:17:29,961 session.execute_statement(sql) 2024-07-16T04:17:29,962 ``` 2024-07-16T04:17:29,962 ### Device Template 2024-07-16T04:17:29,962 #### Create Device Template 2024-07-16T04:17:29,962 The step for creating a metadata template is as follows 2024-07-16T04:17:29,962 1. Create the template class 2024-07-16T04:17:29,962 2. Adding child Node,InternalNode and MeasurementNode can be chose 2024-07-16T04:17:29,962 3. Execute create device template function 2024-07-16T04:17:29,963 ```python 2024-07-16T04:17:29,963 template = Template(name=template_name, share_time=True) 2024-07-16T04:17:29,963 i_node_gps = InternalNode(name="GPS", share_time=False) 2024-07-16T04:17:29,963 i_node_v = InternalNode(name="vehicle", share_time=True) 2024-07-16T04:17:29,963 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2024-07-16T04:17:29,964 i_node_gps.add_child(m_node_x) 2024-07-16T04:17:29,964 i_node_v.add_child(m_node_x) 2024-07-16T04:17:29,964 template.add_template(i_node_gps) 2024-07-16T04:17:29,964 template.add_template(i_node_v) 2024-07-16T04:17:29,964 template.add_template(m_node_x) 2024-07-16T04:17:29,964 session.create_schema_template(template) 2024-07-16T04:17:29,965 ``` 2024-07-16T04:17:29,965 #### Modify Device Template nodes 2024-07-16T04:17:29,965 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2024-07-16T04:17:29,965 * add node in template 2024-07-16T04:17:29,965 ```python 2024-07-16T04:17:29,965 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2024-07-16T04:17:29,965 ``` 2024-07-16T04:17:29,966 * delete node in template 2024-07-16T04:17:29,966 ```python 2024-07-16T04:17:29,966 session.delete_node_in_template(template_name, path) 2024-07-16T04:17:29,966 ``` 2024-07-16T04:17:29,966 #### Set Device Template 2024-07-16T04:17:29,966 ```python 2024-07-16T04:17:29,966 session.set_schema_template(template_name, prefix_path) 2024-07-16T04:17:29,966 ``` 2024-07-16T04:17:29,967 #### Uset Device Template 2024-07-16T04:17:29,967 ```python 2024-07-16T04:17:29,967 session.unset_schema_template(template_name, prefix_path) 2024-07-16T04:17:29,967 ``` 2024-07-16T04:17:29,967 #### Show Device Template 2024-07-16T04:17:29,967 * Show all device templates 2024-07-16T04:17:29,967 ```python 2024-07-16T04:17:29,968 session.show_all_templates() 2024-07-16T04:17:29,968 ``` 2024-07-16T04:17:29,968 * Count all nodes in templates 2024-07-16T04:17:29,968 ```python 2024-07-16T04:17:29,968 session.count_measurements_in_template(template_name) 2024-07-16T04:17:29,968 ``` 2024-07-16T04:17:29,968 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2024-07-16T04:17:29,968 ```python 2024-07-16T04:17:29,969 session.count_measurements_in_template(template_name, path) 2024-07-16T04:17:29,969 ``` 2024-07-16T04:17:29,969 * Judge whether the path is exist or not in templates, This path may not belong to the template 2024-07-16T04:17:29,969 ```python 2024-07-16T04:17:29,969 session.is_path_exist_in_template(template_name, path) 2024-07-16T04:17:29,969 ``` 2024-07-16T04:17:29,969 * Show nodes under in device template 2024-07-16T04:17:29,970 ```python 2024-07-16T04:17:29,970 session.show_measurements_in_template(template_name) 2024-07-16T04:17:29,970 ``` 2024-07-16T04:17:29,970 * Show the path prefix where a device template is set 2024-07-16T04:17:29,970 ```python 2024-07-16T04:17:29,970 session.show_paths_template_set_on(template_name) 2024-07-16T04:17:29,970 ``` 2024-07-16T04:17:29,970 * Show the path prefix where a device template is used (i.e. the time series has been created) 2024-07-16T04:17:29,971 ```python 2024-07-16T04:17:29,971 session.show_paths_template_using_on(template_name) 2024-07-16T04:17:29,971 ``` 2024-07-16T04:17:29,971 #### Drop Device Template 2024-07-16T04:17:29,971 Delete an existing metadata template,dropping an already set template is not supported 2024-07-16T04:17:29,971 ```python 2024-07-16T04:17:29,971 session.drop_schema_template("template_python") 2024-07-16T04:17:29,972 ``` 2024-07-16T04:17:29,972 ### Pandas Support 2024-07-16T04:17:29,972 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2024-07-16T04:17:29,972 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2024-07-16T04:17:29,973 Example: 2024-07-16T04:17:29,973 ```python 2024-07-16T04:17:29,973 from iotdb.Session import Session 2024-07-16T04:17:29,973 ip = "127.0.0.1" 2024-07-16T04:17:29,973 port_ = "6667" 2024-07-16T04:17:29,973 username_ = "root" 2024-07-16T04:17:29,974 password_ = "root" 2024-07-16T04:17:29,974 session = Session(ip, port_, username_, password_) 2024-07-16T04:17:29,974 session.open(False) 2024-07-16T04:17:29,974 result = session.execute_query_statement("SELECT * FROM root.*") 2024-07-16T04:17:29,974 # Transform to Pandas Dataset 2024-07-16T04:17:29,974 df = result.todf() 2024-07-16T04:17:29,975 session.close() 2024-07-16T04:17:29,975 # Now you can work with the dataframe 2024-07-16T04:17:29,975 df = ... 2024-07-16T04:17:29,975 ``` 2024-07-16T04:17:29,975 ### IoTDB Testcontainer 2024-07-16T04:17:29,976 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. 2024-07-16T04:17:29,976 To start (and stop) an IoTDB Database in a Docker container simply do: 2024-07-16T04:17:29,976 ```python 2024-07-16T04:17:29,976 class MyTestCase(unittest.TestCase): 2024-07-16T04:17:29,976 def test_something(self): 2024-07-16T04:17:29,976 with IoTDBContainer() as c: 2024-07-16T04:17:29,977 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2024-07-16T04:17:29,977 session.open(False) 2024-07-16T04:17:29,977 result = session.execute_query_statement("SHOW TIMESERIES") 2024-07-16T04:17:29,977 print(result) 2024-07-16T04:17:29,977 session.close() 2024-07-16T04:17:29,977 ``` 2024-07-16T04:17:29,977 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. 2024-07-16T04:17:29,978 ### IoTDB DBAPI 2024-07-16T04:17:29,978 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2024-07-16T04:17:29,978 interface for accessing databases in Python. 2024-07-16T04:17:29,978 #### Examples 2024-07-16T04:17:29,978 + Initialization 2024-07-16T04:17:29,979 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2024-07-16T04:17:29,979 ```python 2024-07-16T04:17:29,979 from iotdb.dbapi import connect 2024-07-16T04:17:29,979 ip = "127.0.0.1" 2024-07-16T04:17:29,979 port_ = "6667" 2024-07-16T04:17:29,979 username_ = "root" 2024-07-16T04:17:29,980 password_ = "root" 2024-07-16T04:17:29,980 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2024-07-16T04:17:29,980 cursor = conn.cursor() 2024-07-16T04:17:29,980 ``` 2024-07-16T04:17:29,980 + simple SQL statement execution 2024-07-16T04:17:29,980 ```python 2024-07-16T04:17:29,980 cursor.execute("SELECT * FROM root.*") 2024-07-16T04:17:29,980 for row in cursor.fetchall(): 2024-07-16T04:17:29,981 print(row) 2024-07-16T04:17:29,981 ``` 2024-07-16T04:17:29,981 + execute SQL with parameter 2024-07-16T04:17:29,981 IoTDB DBAPI supports pyformat style parameters 2024-07-16T04:17:29,981 ```python 2024-07-16T04:17:29,981 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2024-07-16T04:17:29,982 for row in cursor.fetchall(): 2024-07-16T04:17:29,982 print(row) 2024-07-16T04:17:29,982 ``` 2024-07-16T04:17:29,982 + execute SQL with parameter sequences 2024-07-16T04:17:29,982 ```python 2024-07-16T04:17:29,982 seq_of_parameters = [ 2024-07-16T04:17:29,982 {"timestamp": 1, "temperature": 1}, 2024-07-16T04:17:29,982 {"timestamp": 2, "temperature": 2}, 2024-07-16T04:17:29,983 {"timestamp": 3, "temperature": 3}, 2024-07-16T04:17:29,983 {"timestamp": 4, "temperature": 4}, 2024-07-16T04:17:29,983 {"timestamp": 5, "temperature": 5}, 2024-07-16T04:17:29,983 ] 2024-07-16T04:17:29,983 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2024-07-16T04:17:29,983 cursor.executemany(sql,seq_of_parameters) 2024-07-16T04:17:29,983 ``` 2024-07-16T04:17:29,984 + close the connection and cursor 2024-07-16T04:17:29,984 ```python 2024-07-16T04:17:29,984 cursor.close() 2024-07-16T04:17:29,984 conn.close() 2024-07-16T04:17:29,984 ``` 2024-07-16T04:17:29,984 ### IoTDB SQLAlchemy Dialect (Experimental) 2024-07-16T04:17:29,984 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2024-07-16T04:17:29,985 This part is still being improved. 2024-07-16T04:17:29,985 Please do not use it in the production environment! 2024-07-16T04:17:29,985 #### Mapping of the metadata 2024-07-16T04:17:29,985 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2024-07-16T04:17:29,985 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2024-07-16T04:17:29,985 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2024-07-16T04:17:29,985 Converting the data model of IoTDB into the data model of SQLAlchemy. 2024-07-16T04:17:29,986 The metadata in the IoTDB are: 2024-07-16T04:17:29,986 1. Database 2024-07-16T04:17:29,986 2. Path 2024-07-16T04:17:29,986 3. Entity 2024-07-16T04:17:29,986 4. Measurement 2024-07-16T04:17:29,986 The metadata in the SQLAlchemy are: 2024-07-16T04:17:29,987 1. Schema 2024-07-16T04:17:29,987 2. Table 2024-07-16T04:17:29,987 3. Column 2024-07-16T04:17:29,987 The mapping relationship between them is: 2024-07-16T04:17:29,987 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2024-07-16T04:17:29,987 | -------------------- | ---------------------------------------------- | 2024-07-16T04:17:29,988 | Schema | Database | 2024-07-16T04:17:29,988 | Table | Path ( from database to entity ) + Entity | 2024-07-16T04:17:29,988 | Column | Measurement | 2024-07-16T04:17:29,988 The following figure shows the relationship between the two more intuitively: 2024-07-16T04:17:29,988 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2024-07-16T04:17:29,989 #### Data type mapping 2024-07-16T04:17:29,989 | data type in IoTDB | data type in SQLAlchemy | 2024-07-16T04:17:29,989 |--------------------|-------------------------| 2024-07-16T04:17:29,989 | BOOLEAN | Boolean | 2024-07-16T04:17:29,989 | INT32 | Integer | 2024-07-16T04:17:29,989 | INT64 | BigInteger | 2024-07-16T04:17:29,989 | FLOAT | Float | 2024-07-16T04:17:29,990 | DOUBLE | Float | 2024-07-16T04:17:29,990 | TEXT | Text | 2024-07-16T04:17:29,990 | LONG | BigInteger | 2024-07-16T04:17:29,990 #### Example 2024-07-16T04:17:29,990 + execute statement 2024-07-16T04:17:29,990 ```python 2024-07-16T04:17:29,991 from sqlalchemy import create_engine 2024-07-16T04:17:29,991 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-16T04:17:29,991 connect = engine.connect() 2024-07-16T04:17:29,991 result = connect.execute("SELECT ** FROM root") 2024-07-16T04:17:29,991 for row in result.fetchall(): 2024-07-16T04:17:29,991 print(row) 2024-07-16T04:17:29,991 ``` 2024-07-16T04:17:29,992 + ORM (now only simple queries are supported) 2024-07-16T04:17:29,992 ```python 2024-07-16T04:17:29,992 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2024-07-16T04:17:29,992 from sqlalchemy.ext.declarative import declarative_base 2024-07-16T04:17:29,992 from sqlalchemy.orm import sessionmaker 2024-07-16T04:17:29,993 metadata = MetaData( 2024-07-16T04:17:29,993 schema='root.factory' 2024-07-16T04:17:29,993 ) 2024-07-16T04:17:29,993 Base = declarative_base(metadata=metadata) 2024-07-16T04:17:29,993 class Device(Base): 2024-07-16T04:17:29,993 __tablename__ = "room2.device1" 2024-07-16T04:17:29,993 Time = Column(BigInteger, primary_key=True) 2024-07-16T04:17:29,994 temperature = Column(Float) 2024-07-16T04:17:29,994 status = Column(Float) 2024-07-16T04:17:29,994 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-16T04:17:29,994 DbSession = sessionmaker(bind=engine) 2024-07-16T04:17:29,994 session = DbSession() 2024-07-16T04:17:29,995 res = session.query(Device.status).filter(Device.temperature > 1) 2024-07-16T04:17:29,995 for row in res: 2024-07-16T04:17:29,995 print(row) 2024-07-16T04:17:29,995 ``` 2024-07-16T04:17:29,996 ## Developers 2024-07-16T04:17:29,996 ### Introduction 2024-07-16T04:17:29,996 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. 2024-07-16T04:17:29,996 ### Prerequisites 2024-07-16T04:17:29,997 Python3.7 or later is preferred. 2024-07-16T04:17:29,997 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. 2024-07-16T04:17:29,997 ``` 2024-07-16T04:17:29,997 http://thrift.apache.org/docs/install/ 2024-07-16T04:17:29,997 ``` 2024-07-16T04:17:29,998 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2024-07-16T04:17:29,998 ```shell 2024-07-16T04:17:29,998 pip install -r requirements_dev.txt 2024-07-16T04:17:29,998 ``` 2024-07-16T04:17:29,999 ### Compile the thrift library and Debug 2024-07-16T04:17:29,999 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2024-07-16T04:17:29,999 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2024-07-16T04:17:29,999 This folder is ignored from git and should **never be pushed to git!** 2024-07-16T04:17:29,999 **Notice** Do not upload `iotdb/thrift` to the git repo. 2024-07-16T04:17:30,000 ### Session Client & Example 2024-07-16T04:17:30,000 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. 2024-07-16T04:17:30,001 Or, another simple example: 2024-07-16T04:17:30,001 ```python 2024-07-16T04:17:30,001 from iotdb.Session import Session 2024-07-16T04:17:30,001 ip = "127.0.0.1" 2024-07-16T04:17:30,001 port_ = "6667" 2024-07-16T04:17:30,001 username_ = "root" 2024-07-16T04:17:30,001 password_ = "root" 2024-07-16T04:17:30,002 session = Session(ip, port_, username_, password_) 2024-07-16T04:17:30,002 session.open(False) 2024-07-16T04:17:30,002 zone = session.get_time_zone() 2024-07-16T04:17:30,002 session.close() 2024-07-16T04:17:30,002 ``` 2024-07-16T04:17:30,003 ### Tests 2024-07-16T04:17:30,003 Please add your custom tests in `tests` folder. 2024-07-16T04:17:30,003 To run all defined tests just type `pytest .` in the root folder. 2024-07-16T04:17:30,003 **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). 2024-07-16T04:17:30,004 ### Futher Tools 2024-07-16T04:17:30,004 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2024-07-16T04:17:30,004 Both can be run by `black .` or `flake8 .` respectively. 2024-07-16T04:17:30,005 ## Releasing 2024-07-16T04:17:30,005 To do a release just ensure that you have the right set of generated thrift files. 2024-07-16T04:17:30,005 Then run linting and auto-formatting. 2024-07-16T04:17:30,005 Then, ensure that all tests work (via `pytest .`). 2024-07-16T04:17:30,005 Then you are good to go to do a release! 2024-07-16T04:17:30,006 ### Preparing your environment 2024-07-16T04:17:30,006 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2024-07-16T04:17:30,007 ### Doing the Release 2024-07-16T04:17:30,007 There is a convenient script `release.sh` to do all steps for a release. 2024-07-16T04:17:30,007 Namely, these are 2024-07-16T04:17:30,007 * Remove all transient directories from last release (if exists) 2024-07-16T04:17:30,007 * (Re-)generate all generated sources via mvn 2024-07-16T04:17:30,007 * Run Linting (flake8) 2024-07-16T04:17:30,008 * Run Tests via pytest 2024-07-16T04:17:30,008 * Build 2024-07-16T04:17:30,008 * Release to pypi 2024-07-16T04:17:30,008 /tmp/pip-build-env-heqw98yx/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'website' 2024-07-16T04:17:30,008 warnings.warn(msg) 2024-07-16T04:17:30,009 running dist_info 2024-07-16T04:17:30,009 creating /tmp/pip-modern-metadata-oqugj4s1/apache_iotdb.egg-info 2024-07-16T04:17:30,009 writing /tmp/pip-modern-metadata-oqugj4s1/apache_iotdb.egg-info/PKG-INFO 2024-07-16T04:17:30,010 writing dependency_links to /tmp/pip-modern-metadata-oqugj4s1/apache_iotdb.egg-info/dependency_links.txt 2024-07-16T04:17:30,012 writing entry points to /tmp/pip-modern-metadata-oqugj4s1/apache_iotdb.egg-info/entry_points.txt 2024-07-16T04:17:30,013 writing requirements to /tmp/pip-modern-metadata-oqugj4s1/apache_iotdb.egg-info/requires.txt 2024-07-16T04:17:30,014 writing top-level names to /tmp/pip-modern-metadata-oqugj4s1/apache_iotdb.egg-info/top_level.txt 2024-07-16T04:17:30,016 writing manifest file '/tmp/pip-modern-metadata-oqugj4s1/apache_iotdb.egg-info/SOURCES.txt' 2024-07-16T04:17:30,048 reading manifest file '/tmp/pip-modern-metadata-oqugj4s1/apache_iotdb.egg-info/SOURCES.txt' 2024-07-16T04:17:30,055 writing manifest file '/tmp/pip-modern-metadata-oqugj4s1/apache_iotdb.egg-info/SOURCES.txt' 2024-07-16T04:17:30,056 creating '/tmp/pip-modern-metadata-oqugj4s1/apache_iotdb-1.3.2.post0.dist-info' 2024-07-16T04:17:30,171 Preparing metadata (pyproject.toml): finished with status 'done' 2024-07-16T04:17:30,179 Source in /tmp/pip-wheel-ehdf5cvi/apache-iotdb_699bedafcb7b44efaa47c52838113701 has version 1.3.2.post0, which satisfies requirement apache-iotdb==1.3.2.post0 from https://files.pythonhosted.org/packages/da/d1/4895eca705f20d7a1158771ac25b72703b3a72893ba543c706a9fd286636/apache_iotdb-1.3.2.post0.tar.gz 2024-07-16T04:17:30,180 Removed apache-iotdb==1.3.2.post0 from https://files.pythonhosted.org/packages/da/d1/4895eca705f20d7a1158771ac25b72703b3a72893ba543c706a9fd286636/apache_iotdb-1.3.2.post0.tar.gz from build tracker '/tmp/pip-build-tracker-zljf12zd' 2024-07-16T04:17:30,188 Created temporary directory: /tmp/pip-unpack-4x1nw8kd 2024-07-16T04:17:30,189 Created temporary directory: /tmp/pip-unpack-bugn663m 2024-07-16T04:17:30,200 Building wheels for collected packages: apache-iotdb 2024-07-16T04:17:30,204 Created temporary directory: /tmp/pip-wheel-oo7oj12s 2024-07-16T04:17:30,204 Destination directory: /tmp/pip-wheel-oo7oj12s 2024-07-16T04:17:30,206 Building wheel for apache-iotdb (pyproject.toml): started 2024-07-16T04:17:30,207 Running command Building wheel for apache-iotdb (pyproject.toml) 2024-07-16T04:17:30,696 2024-07-16T04:17:30,699 # Apache IoTDB 2024-07-16T04:17:30,699 [![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) 2024-07-16T04:17:30,699 [![GitHub release](https://img.shields.io/github/release/apache/iotdb.svg)](https://github.com/apache/iotdb/releases) 2024-07-16T04:17:30,699 [![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) 2024-07-16T04:17:30,700 ![](https://github-size-badge.herokuapp.com/apache/iotdb.svg) 2024-07-16T04:17:30,700 ![](https://img.shields.io/github/downloads/apache/iotdb/total.svg) 2024-07-16T04:17:30,700 ![](https://img.shields.io/badge/platform-win%20%7C%20macos%20%7C%20linux-yellow.svg) 2024-07-16T04:17:30,700 [![IoTDB Website](https://img.shields.io/website-up-down-green-red/https/shields.io.svg?label=iotdb-website)](https://iotdb.apache.org/) 2024-07-16T04:17:30,700 Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for 2024-07-16T04:17:30,700 data management and analysis, deployable on the edge and the cloud. Due to its light-weight 2024-07-16T04:17:30,701 architecture, high performance and rich feature set together with its deep integration with 2024-07-16T04:17:30,701 Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, 2024-07-16T04:17:30,701 high-speed data ingestion and complex data analysis in the IoT industrial fields. 2024-07-16T04:17:30,701 ## Python Native API 2024-07-16T04:17:30,701 ### Requirements 2024-07-16T04:17:30,702 You have to install thrift (>=0.13) before using the package. 2024-07-16T04:17:30,702 ### How to use (Example) 2024-07-16T04:17:30,702 First, download the latest package: `pip3 install apache-iotdb` 2024-07-16T04:17:30,703 *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!* 2024-07-16T04:17:30,703 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) 2024-07-16T04:17:30,703 An example of aligned timeseries: [Aligned Timeseries Session Example](https://github.com/apache/iotdb/blob/master/client-py/SessionAlignedTimeseriesExample.py) 2024-07-16T04:17:30,703 (you need to add `import iotdb` in the head of the file) 2024-07-16T04:17:30,704 Or: 2024-07-16T04:17:30,704 ```python 2024-07-16T04:17:30,704 from iotdb.Session import Session 2024-07-16T04:17:30,704 ip = "127.0.0.1" 2024-07-16T04:17:30,705 port_ = "6667" 2024-07-16T04:17:30,705 username_ = "root" 2024-07-16T04:17:30,705 password_ = "root" 2024-07-16T04:17:30,705 session = Session(ip, port_, username_, password_) 2024-07-16T04:17:30,705 session.open(False) 2024-07-16T04:17:30,705 zone = session.get_time_zone() 2024-07-16T04:17:30,705 session.close() 2024-07-16T04:17:30,705 ``` 2024-07-16T04:17:30,706 ### Initialization 2024-07-16T04:17:30,706 * Initialize a Session 2024-07-16T04:17:30,706 ```python 2024-07-16T04:17:30,706 session = Session(ip, port_, username_, password_, fetch_size=1024, zone_id="UTC+8") 2024-07-16T04:17:30,706 ``` 2024-07-16T04:17:30,707 * Open a session, with a parameter to specify whether to enable RPC compression 2024-07-16T04:17:30,707 ```python 2024-07-16T04:17:30,707 session.open(enable_rpc_compression=False) 2024-07-16T04:17:30,707 ``` 2024-07-16T04:17:30,707 Notice: this RPC compression status of client must comply with that of IoTDB server 2024-07-16T04:17:30,708 * Close a Session 2024-07-16T04:17:30,708 ```python 2024-07-16T04:17:30,708 session.close() 2024-07-16T04:17:30,708 ``` 2024-07-16T04:17:30,709 ### Data Definition Interface (DDL Interface) 2024-07-16T04:17:30,709 #### DATABASE Management 2024-07-16T04:17:30,709 * CREATE DATABASE 2024-07-16T04:17:30,709 ```python 2024-07-16T04:17:30,709 session.set_storage_group(group_name) 2024-07-16T04:17:30,709 ``` 2024-07-16T04:17:30,710 * Delete one or several databases 2024-07-16T04:17:30,710 ```python 2024-07-16T04:17:30,710 session.delete_storage_group(group_name) 2024-07-16T04:17:30,710 session.delete_storage_groups(group_name_lst) 2024-07-16T04:17:30,710 ``` 2024-07-16T04:17:30,711 #### Timeseries Management 2024-07-16T04:17:30,711 * Create one or multiple timeseries 2024-07-16T04:17:30,711 ```python 2024-07-16T04:17:30,711 session.create_time_series(ts_path, data_type, encoding, compressor, 2024-07-16T04:17:30,711 props=None, tags=None, attributes=None, alias=None) 2024-07-16T04:17:30,711 session.create_multi_time_series( 2024-07-16T04:17:30,712 ts_path_lst, data_type_lst, encoding_lst, compressor_lst, 2024-07-16T04:17:30,712 props_lst=None, tags_lst=None, attributes_lst=None, alias_lst=None 2024-07-16T04:17:30,712 ) 2024-07-16T04:17:30,712 ``` 2024-07-16T04:17:30,712 * Create aligned timeseries 2024-07-16T04:17:30,712 ```python 2024-07-16T04:17:30,712 session.create_aligned_time_series( 2024-07-16T04:17:30,713 device_id, measurements_lst, data_type_lst, encoding_lst, compressor_lst 2024-07-16T04:17:30,713 ) 2024-07-16T04:17:30,713 ``` 2024-07-16T04:17:30,713 Attention: Alias of measurements are **not supported** currently. 2024-07-16T04:17:30,713 * Delete one or several timeseries 2024-07-16T04:17:30,714 ```python 2024-07-16T04:17:30,714 session.delete_time_series(paths_list) 2024-07-16T04:17:30,714 ``` 2024-07-16T04:17:30,714 * Check whether the specific timeseries exists 2024-07-16T04:17:30,714 ```python 2024-07-16T04:17:30,715 session.check_time_series_exists(path) 2024-07-16T04:17:30,715 ``` 2024-07-16T04:17:30,715 ### Data Manipulation Interface (DML Interface) 2024-07-16T04:17:30,715 #### Insert 2024-07-16T04:17:30,716 It is recommended to use insertTablet to help improve write efficiency. 2024-07-16T04:17:30,716 * Insert a Tablet,which is multiple rows of a device, each row has the same measurements 2024-07-16T04:17:30,716 * **Better Write Performance** 2024-07-16T04:17:30,716 * **Support null values**: fill the null value with any value, and then mark the null value via BitMap (from v0.13) 2024-07-16T04:17:30,716 We have two implementations of Tablet in Python API. 2024-07-16T04:17:30,717 * Normal Tablet 2024-07-16T04:17:30,717 ```python 2024-07-16T04:17:30,717 values_ = [ 2024-07-16T04:17:30,717 [False, 10, 11, 1.1, 10011.1, "test01"], 2024-07-16T04:17:30,717 [True, 100, 11111, 1.25, 101.0, "test02"], 2024-07-16T04:17:30,717 [False, 100, 1, 188.1, 688.25, "test03"], 2024-07-16T04:17:30,717 [True, 0, 0, 0, 6.25, "test04"], 2024-07-16T04:17:30,718 ] 2024-07-16T04:17:30,718 timestamps_ = [1, 2, 3, 4] 2024-07-16T04:17:30,718 tablet_ = Tablet( 2024-07-16T04:17:30,718 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-16T04:17:30,718 ) 2024-07-16T04:17:30,718 session.insert_tablet(tablet_) 2024-07-16T04:17:30,718 values_ = [ 2024-07-16T04:17:30,718 [None, 10, 11, 1.1, 10011.1, "test01"], 2024-07-16T04:17:30,719 [True, None, 11111, 1.25, 101.0, "test02"], 2024-07-16T04:17:30,719 [False, 100, None, 188.1, 688.25, "test03"], 2024-07-16T04:17:30,719 [True, 0, 0, 0, None, None], 2024-07-16T04:17:30,719 ] 2024-07-16T04:17:30,719 timestamps_ = [16, 17, 18, 19] 2024-07-16T04:17:30,719 tablet_ = Tablet( 2024-07-16T04:17:30,719 device_id, measurements_, data_types_, values_, timestamps_ 2024-07-16T04:17:30,719 ) 2024-07-16T04:17:30,719 session.insert_tablet(tablet_) 2024-07-16T04:17:30,720 ``` 2024-07-16T04:17:30,720 * Numpy Tablet 2024-07-16T04:17:30,720 Comparing with Tablet, Numpy Tablet is using [numpy.ndarray](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html) to record data. 2024-07-16T04:17:30,720 With less memory footprint and time cost of serialization, the insert performance will be better. 2024-07-16T04:17:30,720 **Notice** 2024-07-16T04:17:30,720 1. time and value columns in Tablet are ndarray. 2024-07-16T04:17:30,721 2. recommended to use the specific dtypes to each ndarray, see the example below 2024-07-16T04:17:30,721 (if not, the default dtypes are also ok). 2024-07-16T04:17:30,721 ```python 2024-07-16T04:17:30,721 import numpy as np 2024-07-16T04:17:30,721 data_types_ = [ 2024-07-16T04:17:30,721 TSDataType.BOOLEAN, 2024-07-16T04:17:30,721 TSDataType.INT32, 2024-07-16T04:17:30,721 TSDataType.INT64, 2024-07-16T04:17:30,722 TSDataType.FLOAT, 2024-07-16T04:17:30,722 TSDataType.DOUBLE, 2024-07-16T04:17:30,722 TSDataType.TEXT, 2024-07-16T04:17:30,722 ] 2024-07-16T04:17:30,722 np_values_ = [ 2024-07-16T04:17:30,722 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-16T04:17:30,722 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-16T04:17:30,722 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-16T04:17:30,723 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-16T04:17:30,723 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-16T04:17:30,723 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-16T04:17:30,723 ] 2024-07-16T04:17:30,723 np_timestamps_ = np.array([1, 2, 3, 4], TSDataType.INT64.np_dtype()) 2024-07-16T04:17:30,723 np_tablet_ = NumpyTablet( 2024-07-16T04:17:30,723 device_id, measurements_, data_types_, np_values_, np_timestamps_ 2024-07-16T04:17:30,723 ) 2024-07-16T04:17:30,723 session.insert_tablet(np_tablet_) 2024-07-16T04:17:30,724 # insert one numpy tablet with none into the database. 2024-07-16T04:17:30,724 np_values_ = [ 2024-07-16T04:17:30,724 np.array([False, True, False, True], TSDataType.BOOLEAN.np_dtype()), 2024-07-16T04:17:30,724 np.array([10, 100, 100, 0], TSDataType.INT32.np_dtype()), 2024-07-16T04:17:30,724 np.array([11, 11111, 1, 0], TSDataType.INT64.np_dtype()), 2024-07-16T04:17:30,724 np.array([1.1, 1.25, 188.1, 0], TSDataType.FLOAT.np_dtype()), 2024-07-16T04:17:30,725 np.array([10011.1, 101.0, 688.25, 6.25], TSDataType.DOUBLE.np_dtype()), 2024-07-16T04:17:30,725 np.array(["test01", "test02", "test03", "test04"], TSDataType.TEXT.np_dtype()), 2024-07-16T04:17:30,725 ] 2024-07-16T04:17:30,725 np_timestamps_ = np.array([98, 99, 100, 101], TSDataType.INT64.np_dtype()) 2024-07-16T04:17:30,725 np_bitmaps_ = [] 2024-07-16T04:17:30,725 for i in range(len(measurements_)): 2024-07-16T04:17:30,725 np_bitmaps_.append(BitMap(len(np_timestamps_))) 2024-07-16T04:17:30,725 np_bitmaps_[0].mark(0) 2024-07-16T04:17:30,726 np_bitmaps_[1].mark(1) 2024-07-16T04:17:30,726 np_bitmaps_[2].mark(2) 2024-07-16T04:17:30,726 np_bitmaps_[4].mark(3) 2024-07-16T04:17:30,726 np_bitmaps_[5].mark(3) 2024-07-16T04:17:30,726 np_tablet_with_none = NumpyTablet( 2024-07-16T04:17:30,726 device_id, measurements_, data_types_, np_values_, np_timestamps_, np_bitmaps_ 2024-07-16T04:17:30,726 ) 2024-07-16T04:17:30,726 session.insert_tablet(np_tablet_with_none) 2024-07-16T04:17:30,727 ``` 2024-07-16T04:17:30,727 * Insert multiple Tablets 2024-07-16T04:17:30,727 ```python 2024-07-16T04:17:30,727 session.insert_tablets(tablet_lst) 2024-07-16T04:17:30,727 ``` 2024-07-16T04:17:30,727 * Insert a Record 2024-07-16T04:17:30,728 ```python 2024-07-16T04:17:30,728 session.insert_record(device_id, timestamp, measurements_, data_types_, values_) 2024-07-16T04:17:30,728 ``` 2024-07-16T04:17:30,728 * Insert multiple Records 2024-07-16T04:17:30,728 ```python 2024-07-16T04:17:30,729 session.insert_records( 2024-07-16T04:17:30,729 device_ids_, time_list_, measurements_list_, data_type_list_, values_list_ 2024-07-16T04:17:30,729 ) 2024-07-16T04:17:30,729 ``` 2024-07-16T04:17:30,729 * Insert multiple Records that belong to the same device. 2024-07-16T04:17:30,729 With type info the server has no need to do type inference, which leads a better performance 2024-07-16T04:17:30,730 ```python 2024-07-16T04:17:30,730 session.insert_records_of_one_device(device_id, time_list, measurements_list, data_types_list, values_list) 2024-07-16T04:17:30,730 ``` 2024-07-16T04:17:30,730 #### Insert with type inference 2024-07-16T04:17:30,730 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. 2024-07-16T04:17:30,731 * Insert a Record, which contains multiple measurement value of a device at a timestamp 2024-07-16T04:17:30,731 ```python 2024-07-16T04:17:30,731 session.insert_str_record(device_id, timestamp, measurements, string_values) 2024-07-16T04:17:30,731 ``` 2024-07-16T04:17:30,731 #### Insert of Aligned Timeseries 2024-07-16T04:17:30,732 The Insert of aligned timeseries uses interfaces like insert_aligned_XXX, and others are similar to the above interfaces: 2024-07-16T04:17:30,732 * insert_aligned_record 2024-07-16T04:17:30,732 * insert_aligned_records 2024-07-16T04:17:30,732 * insert_aligned_records_of_one_device 2024-07-16T04:17:30,732 * insert_aligned_tablet 2024-07-16T04:17:30,732 * insert_aligned_tablets 2024-07-16T04:17:30,733 ### IoTDB-SQL Interface 2024-07-16T04:17:30,733 * Execute query statement 2024-07-16T04:17:30,733 ```python 2024-07-16T04:17:30,734 session.execute_query_statement(sql) 2024-07-16T04:17:30,734 ``` 2024-07-16T04:17:30,734 * Execute non query statement 2024-07-16T04:17:30,734 ```python 2024-07-16T04:17:30,734 session.execute_non_query_statement(sql) 2024-07-16T04:17:30,734 ``` 2024-07-16T04:17:30,735 * Execute statement 2024-07-16T04:17:30,735 ```python 2024-07-16T04:17:30,735 session.execute_statement(sql) 2024-07-16T04:17:30,735 ``` 2024-07-16T04:17:30,735 ### Device Template 2024-07-16T04:17:30,736 #### Create Device Template 2024-07-16T04:17:30,736 The step for creating a metadata template is as follows 2024-07-16T04:17:30,736 1. Create the template class 2024-07-16T04:17:30,736 2. Adding child Node,InternalNode and MeasurementNode can be chose 2024-07-16T04:17:30,736 3. Execute create device template function 2024-07-16T04:17:30,736 ```python 2024-07-16T04:17:30,736 template = Template(name=template_name, share_time=True) 2024-07-16T04:17:30,737 i_node_gps = InternalNode(name="GPS", share_time=False) 2024-07-16T04:17:30,737 i_node_v = InternalNode(name="vehicle", share_time=True) 2024-07-16T04:17:30,737 m_node_x = MeasurementNode("x", TSDataType.FLOAT, TSEncoding.RLE, Compressor.SNAPPY) 2024-07-16T04:17:30,737 i_node_gps.add_child(m_node_x) 2024-07-16T04:17:30,737 i_node_v.add_child(m_node_x) 2024-07-16T04:17:30,737 template.add_template(i_node_gps) 2024-07-16T04:17:30,738 template.add_template(i_node_v) 2024-07-16T04:17:30,738 template.add_template(m_node_x) 2024-07-16T04:17:30,738 session.create_schema_template(template) 2024-07-16T04:17:30,738 ``` 2024-07-16T04:17:30,738 #### Modify Device Template nodes 2024-07-16T04:17:30,738 Modify nodes in a template, the template must be already created. These are functions that add or delete some measurement nodes. 2024-07-16T04:17:30,738 * add node in template 2024-07-16T04:17:30,738 ```python 2024-07-16T04:17:30,739 session.add_measurements_in_template(template_name, measurements_path, data_types, encodings, compressors, is_aligned) 2024-07-16T04:17:30,739 ``` 2024-07-16T04:17:30,739 * delete node in template 2024-07-16T04:17:30,739 ```python 2024-07-16T04:17:30,739 session.delete_node_in_template(template_name, path) 2024-07-16T04:17:30,739 ``` 2024-07-16T04:17:30,740 #### Set Device Template 2024-07-16T04:17:30,740 ```python 2024-07-16T04:17:30,740 session.set_schema_template(template_name, prefix_path) 2024-07-16T04:17:30,740 ``` 2024-07-16T04:17:30,740 #### Uset Device Template 2024-07-16T04:17:30,740 ```python 2024-07-16T04:17:30,740 session.unset_schema_template(template_name, prefix_path) 2024-07-16T04:17:30,740 ``` 2024-07-16T04:17:30,741 #### Show Device Template 2024-07-16T04:17:30,741 * Show all device templates 2024-07-16T04:17:30,741 ```python 2024-07-16T04:17:30,741 session.show_all_templates() 2024-07-16T04:17:30,741 ``` 2024-07-16T04:17:30,741 * Count all nodes in templates 2024-07-16T04:17:30,741 ```python 2024-07-16T04:17:30,741 session.count_measurements_in_template(template_name) 2024-07-16T04:17:30,742 ``` 2024-07-16T04:17:30,742 * Judge whether the path is measurement or not in templates, This measurement must be in the template 2024-07-16T04:17:30,742 ```python 2024-07-16T04:17:30,742 session.count_measurements_in_template(template_name, path) 2024-07-16T04:17:30,742 ``` 2024-07-16T04:17:30,742 * Judge whether the path is exist or not in templates, This path may not belong to the template 2024-07-16T04:17:30,742 ```python 2024-07-16T04:17:30,743 session.is_path_exist_in_template(template_name, path) 2024-07-16T04:17:30,743 ``` 2024-07-16T04:17:30,743 * Show nodes under in device template 2024-07-16T04:17:30,743 ```python 2024-07-16T04:17:30,743 session.show_measurements_in_template(template_name) 2024-07-16T04:17:30,743 ``` 2024-07-16T04:17:30,744 * Show the path prefix where a device template is set 2024-07-16T04:17:30,744 ```python 2024-07-16T04:17:30,744 session.show_paths_template_set_on(template_name) 2024-07-16T04:17:30,744 ``` 2024-07-16T04:17:30,744 * Show the path prefix where a device template is used (i.e. the time series has been created) 2024-07-16T04:17:30,744 ```python 2024-07-16T04:17:30,745 session.show_paths_template_using_on(template_name) 2024-07-16T04:17:30,745 ``` 2024-07-16T04:17:30,745 #### Drop Device Template 2024-07-16T04:17:30,745 Delete an existing metadata template,dropping an already set template is not supported 2024-07-16T04:17:30,745 ```python 2024-07-16T04:17:30,745 session.drop_schema_template("template_python") 2024-07-16T04:17:30,745 ``` 2024-07-16T04:17:30,746 ### Pandas Support 2024-07-16T04:17:30,746 To easily transform a query result to a [Pandas Dataframe](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html) 2024-07-16T04:17:30,746 the SessionDataSet has a method `.todf()` which consumes the dataset and transforms it to a pandas dataframe. 2024-07-16T04:17:30,746 Example: 2024-07-16T04:17:30,747 ```python 2024-07-16T04:17:30,747 from iotdb.Session import Session 2024-07-16T04:17:30,747 ip = "127.0.0.1" 2024-07-16T04:17:30,747 port_ = "6667" 2024-07-16T04:17:30,747 username_ = "root" 2024-07-16T04:17:30,747 password_ = "root" 2024-07-16T04:17:30,748 session = Session(ip, port_, username_, password_) 2024-07-16T04:17:30,748 session.open(False) 2024-07-16T04:17:30,748 result = session.execute_query_statement("SELECT * FROM root.*") 2024-07-16T04:17:30,748 # Transform to Pandas Dataset 2024-07-16T04:17:30,748 df = result.todf() 2024-07-16T04:17:30,748 session.close() 2024-07-16T04:17:30,749 # Now you can work with the dataframe 2024-07-16T04:17:30,749 df = ... 2024-07-16T04:17:30,749 ``` 2024-07-16T04:17:30,749 ### IoTDB Testcontainer 2024-07-16T04:17:30,750 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. 2024-07-16T04:17:30,750 To start (and stop) an IoTDB Database in a Docker container simply do: 2024-07-16T04:17:30,750 ```python 2024-07-16T04:17:30,750 class MyTestCase(unittest.TestCase): 2024-07-16T04:17:30,750 def test_something(self): 2024-07-16T04:17:30,750 with IoTDBContainer() as c: 2024-07-16T04:17:30,751 session = Session("localhost", c.get_exposed_port(6667), "root", "root") 2024-07-16T04:17:30,751 session.open(False) 2024-07-16T04:17:30,751 result = session.execute_query_statement("SHOW TIMESERIES") 2024-07-16T04:17:30,751 print(result) 2024-07-16T04:17:30,751 session.close() 2024-07-16T04:17:30,751 ``` 2024-07-16T04:17:30,752 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. 2024-07-16T04:17:30,752 ### IoTDB DBAPI 2024-07-16T04:17:30,752 IoTDB DBAPI implements the Python DB API 2.0 specification (https://peps.python.org/pep-0249/), which defines a common 2024-07-16T04:17:30,752 interface for accessing databases in Python. 2024-07-16T04:17:30,753 #### Examples 2024-07-16T04:17:30,753 + Initialization 2024-07-16T04:17:30,753 The initialized parameters are consistent with the session part (except for the sqlalchemy_mode). 2024-07-16T04:17:30,753 ```python 2024-07-16T04:17:30,753 from iotdb.dbapi import connect 2024-07-16T04:17:30,753 ip = "127.0.0.1" 2024-07-16T04:17:30,754 port_ = "6667" 2024-07-16T04:17:30,754 username_ = "root" 2024-07-16T04:17:30,754 password_ = "root" 2024-07-16T04:17:30,754 conn = connect(ip, port_, username_, password_,fetch_size=1024,zone_id="UTC+8",sqlalchemy_mode=False) 2024-07-16T04:17:30,754 cursor = conn.cursor() 2024-07-16T04:17:30,754 ``` 2024-07-16T04:17:30,754 + simple SQL statement execution 2024-07-16T04:17:30,755 ```python 2024-07-16T04:17:30,755 cursor.execute("SELECT * FROM root.*") 2024-07-16T04:17:30,755 for row in cursor.fetchall(): 2024-07-16T04:17:30,755 print(row) 2024-07-16T04:17:30,755 ``` 2024-07-16T04:17:30,755 + execute SQL with parameter 2024-07-16T04:17:30,756 IoTDB DBAPI supports pyformat style parameters 2024-07-16T04:17:30,756 ```python 2024-07-16T04:17:30,756 cursor.execute("SELECT * FROM root.* WHERE time < %(time)s",{"time":"2017-11-01T00:08:00.000"}) 2024-07-16T04:17:30,756 for row in cursor.fetchall(): 2024-07-16T04:17:30,756 print(row) 2024-07-16T04:17:30,756 ``` 2024-07-16T04:17:30,757 + execute SQL with parameter sequences 2024-07-16T04:17:30,757 ```python 2024-07-16T04:17:30,757 seq_of_parameters = [ 2024-07-16T04:17:30,757 {"timestamp": 1, "temperature": 1}, 2024-07-16T04:17:30,757 {"timestamp": 2, "temperature": 2}, 2024-07-16T04:17:30,757 {"timestamp": 3, "temperature": 3}, 2024-07-16T04:17:30,757 {"timestamp": 4, "temperature": 4}, 2024-07-16T04:17:30,757 {"timestamp": 5, "temperature": 5}, 2024-07-16T04:17:30,758 ] 2024-07-16T04:17:30,758 sql = "insert into root.cursor(timestamp,temperature) values(%(timestamp)s,%(temperature)s)" 2024-07-16T04:17:30,758 cursor.executemany(sql,seq_of_parameters) 2024-07-16T04:17:30,758 ``` 2024-07-16T04:17:30,758 + close the connection and cursor 2024-07-16T04:17:30,758 ```python 2024-07-16T04:17:30,759 cursor.close() 2024-07-16T04:17:30,759 conn.close() 2024-07-16T04:17:30,759 ``` 2024-07-16T04:17:30,759 ### IoTDB SQLAlchemy Dialect (Experimental) 2024-07-16T04:17:30,759 The SQLAlchemy dialect of IoTDB is written to adapt to Apache Superset. 2024-07-16T04:17:30,759 This part is still being improved. 2024-07-16T04:17:30,759 Please do not use it in the production environment! 2024-07-16T04:17:30,760 #### Mapping of the metadata 2024-07-16T04:17:30,760 The data model used by SQLAlchemy is a relational data model, which describes the relationships between different entities through tables. 2024-07-16T04:17:30,760 While the data model of IoTDB is a hierarchical data model, which organizes the data through a tree structure. 2024-07-16T04:17:30,760 In order to adapt IoTDB to the dialect of SQLAlchemy, the original data model in IoTDB needs to be reorganized. 2024-07-16T04:17:30,760 Converting the data model of IoTDB into the data model of SQLAlchemy. 2024-07-16T04:17:30,760 The metadata in the IoTDB are: 2024-07-16T04:17:30,761 1. Database 2024-07-16T04:17:30,761 2. Path 2024-07-16T04:17:30,761 3. Entity 2024-07-16T04:17:30,761 4. Measurement 2024-07-16T04:17:30,761 The metadata in the SQLAlchemy are: 2024-07-16T04:17:30,761 1. Schema 2024-07-16T04:17:30,761 2. Table 2024-07-16T04:17:30,762 3. Column 2024-07-16T04:17:30,762 The mapping relationship between them is: 2024-07-16T04:17:30,762 | The metadata in the SQLAlchemy | The metadata in the IoTDB | 2024-07-16T04:17:30,762 | -------------------- | ---------------------------------------------- | 2024-07-16T04:17:30,762 | Schema | Database | 2024-07-16T04:17:30,762 | Table | Path ( from database to entity ) + Entity | 2024-07-16T04:17:30,763 | Column | Measurement | 2024-07-16T04:17:30,763 The following figure shows the relationship between the two more intuitively: 2024-07-16T04:17:30,763 ![sqlalchemy-to-iotdb](https://github.com/apache/iotdb-bin-resources/blob/main/docs/UserGuide/API/IoTDB-SQLAlchemy/sqlalchemy-to-iotdb.png?raw=true) 2024-07-16T04:17:30,763 #### Data type mapping 2024-07-16T04:17:30,763 | data type in IoTDB | data type in SQLAlchemy | 2024-07-16T04:17:30,764 |--------------------|-------------------------| 2024-07-16T04:17:30,764 | BOOLEAN | Boolean | 2024-07-16T04:17:30,764 | INT32 | Integer | 2024-07-16T04:17:30,764 | INT64 | BigInteger | 2024-07-16T04:17:30,764 | FLOAT | Float | 2024-07-16T04:17:30,764 | DOUBLE | Float | 2024-07-16T04:17:30,764 | TEXT | Text | 2024-07-16T04:17:30,764 | LONG | BigInteger | 2024-07-16T04:17:30,765 #### Example 2024-07-16T04:17:30,765 + execute statement 2024-07-16T04:17:30,765 ```python 2024-07-16T04:17:30,765 from sqlalchemy import create_engine 2024-07-16T04:17:30,765 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-16T04:17:30,766 connect = engine.connect() 2024-07-16T04:17:30,766 result = connect.execute("SELECT ** FROM root") 2024-07-16T04:17:30,766 for row in result.fetchall(): 2024-07-16T04:17:30,766 print(row) 2024-07-16T04:17:30,766 ``` 2024-07-16T04:17:30,766 + ORM (now only simple queries are supported) 2024-07-16T04:17:30,767 ```python 2024-07-16T04:17:30,767 from sqlalchemy import create_engine, Column, Float, BigInteger, MetaData 2024-07-16T04:17:30,767 from sqlalchemy.ext.declarative import declarative_base 2024-07-16T04:17:30,767 from sqlalchemy.orm import sessionmaker 2024-07-16T04:17:30,767 metadata = MetaData( 2024-07-16T04:17:30,767 schema='root.factory' 2024-07-16T04:17:30,767 ) 2024-07-16T04:17:30,767 Base = declarative_base(metadata=metadata) 2024-07-16T04:17:30,768 class Device(Base): 2024-07-16T04:17:30,768 __tablename__ = "room2.device1" 2024-07-16T04:17:30,768 Time = Column(BigInteger, primary_key=True) 2024-07-16T04:17:30,768 temperature = Column(Float) 2024-07-16T04:17:30,768 status = Column(Float) 2024-07-16T04:17:30,769 engine = create_engine("iotdb://root:root@127.0.0.1:6667") 2024-07-16T04:17:30,769 DbSession = sessionmaker(bind=engine) 2024-07-16T04:17:30,769 session = DbSession() 2024-07-16T04:17:30,769 res = session.query(Device.status).filter(Device.temperature > 1) 2024-07-16T04:17:30,770 for row in res: 2024-07-16T04:17:30,770 print(row) 2024-07-16T04:17:30,770 ``` 2024-07-16T04:17:30,770 ## Developers 2024-07-16T04:17:30,770 ### Introduction 2024-07-16T04:17:30,771 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. 2024-07-16T04:17:30,771 ### Prerequisites 2024-07-16T04:17:30,771 Python3.7 or later is preferred. 2024-07-16T04:17:30,772 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. 2024-07-16T04:17:30,772 ``` 2024-07-16T04:17:30,772 http://thrift.apache.org/docs/install/ 2024-07-16T04:17:30,772 ``` 2024-07-16T04:17:30,772 Before starting you need to install `requirements_dev.txt` in your python environment, e.g. by calling 2024-07-16T04:17:30,772 ```shell 2024-07-16T04:17:30,773 pip install -r requirements_dev.txt 2024-07-16T04:17:30,773 ``` 2024-07-16T04:17:30,773 ### Compile the thrift library and Debug 2024-07-16T04:17:30,773 In the root of IoTDB's source code folder, run `mvn clean generate-sources -pl client-py -am`. 2024-07-16T04:17:30,774 This will automatically delete and repopulate the folder `iotdb/thrift` with the generated thrift files. 2024-07-16T04:17:30,774 This folder is ignored from git and should **never be pushed to git!** 2024-07-16T04:17:30,774 **Notice** Do not upload `iotdb/thrift` to the git repo. 2024-07-16T04:17:30,775 ### Session Client & Example 2024-07-16T04:17:30,775 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. 2024-07-16T04:17:30,775 Or, another simple example: 2024-07-16T04:17:30,775 ```python 2024-07-16T04:17:30,776 from iotdb.Session import Session 2024-07-16T04:17:30,776 ip = "127.0.0.1" 2024-07-16T04:17:30,776 port_ = "6667" 2024-07-16T04:17:30,776 username_ = "root" 2024-07-16T04:17:30,776 password_ = "root" 2024-07-16T04:17:30,776 session = Session(ip, port_, username_, password_) 2024-07-16T04:17:30,776 session.open(False) 2024-07-16T04:17:30,777 zone = session.get_time_zone() 2024-07-16T04:17:30,777 session.close() 2024-07-16T04:17:30,777 ``` 2024-07-16T04:17:30,777 ### Tests 2024-07-16T04:17:30,778 Please add your custom tests in `tests` folder. 2024-07-16T04:17:30,778 To run all defined tests just type `pytest .` in the root folder. 2024-07-16T04:17:30,778 **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). 2024-07-16T04:17:30,778 ### Futher Tools 2024-07-16T04:17:30,779 [black](https://pypi.org/project/black/) and [flake8](https://pypi.org/project/flake8/) are installed for autoformatting and linting. 2024-07-16T04:17:30,779 Both can be run by `black .` or `flake8 .` respectively. 2024-07-16T04:17:30,779 ## Releasing 2024-07-16T04:17:30,780 To do a release just ensure that you have the right set of generated thrift files. 2024-07-16T04:17:30,780 Then run linting and auto-formatting. 2024-07-16T04:17:30,780 Then, ensure that all tests work (via `pytest .`). 2024-07-16T04:17:30,780 Then you are good to go to do a release! 2024-07-16T04:17:30,780 ### Preparing your environment 2024-07-16T04:17:30,781 First, install all necessary dev dependencies via `pip install -r requirements_dev.txt`. 2024-07-16T04:17:30,781 ### Doing the Release 2024-07-16T04:17:30,781 There is a convenient script `release.sh` to do all steps for a release. 2024-07-16T04:17:30,782 Namely, these are 2024-07-16T04:17:30,782 * Remove all transient directories from last release (if exists) 2024-07-16T04:17:30,782 * (Re-)generate all generated sources via mvn 2024-07-16T04:17:30,782 * Run Linting (flake8) 2024-07-16T04:17:30,782 * Run Tests via pytest 2024-07-16T04:17:30,782 * Build 2024-07-16T04:17:30,782 * Release to pypi 2024-07-16T04:17:30,783 /tmp/pip-build-env-heqw98yx/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'website' 2024-07-16T04:17:30,783 warnings.warn(msg) 2024-07-16T04:17:30,783 running bdist_wheel 2024-07-16T04:17:30,807 running build 2024-07-16T04:17:30,807 running build_py 2024-07-16T04:17:30,820 creating build 2024-07-16T04:17:30,821 creating build/lib 2024-07-16T04:17:30,821 creating build/lib/tests 2024-07-16T04:17:30,822 copying tests/tablet_performance_comparison.py -> build/lib/tests 2024-07-16T04:17:30,825 copying tests/__init__.py -> build/lib/tests 2024-07-16T04:17:30,826 copying tests/test_delete_data.py -> build/lib/tests 2024-07-16T04:17:30,828 copying tests/test_session.py -> build/lib/tests 2024-07-16T04:17:30,831 copying tests/test_dataframe.py -> build/lib/tests 2024-07-16T04:17:30,833 copying tests/test_session_pool.py -> build/lib/tests 2024-07-16T04:17:30,834 copying tests/test_numpy_tablet.py -> build/lib/tests 2024-07-16T04:17:30,836 copying tests/test_todf.py -> build/lib/tests 2024-07-16T04:17:30,838 copying tests/test_tablet.py -> build/lib/tests 2024-07-16T04:17:30,840 copying tests/test_one_device.py -> build/lib/tests 2024-07-16T04:17:30,842 copying tests/test_template.py -> build/lib/tests 2024-07-16T04:17:30,844 copying tests/test_aligned_timeseries.py -> build/lib/tests 2024-07-16T04:17:30,847 creating build/lib/iotdb 2024-07-16T04:17:30,848 copying iotdb/__init__.py -> build/lib/iotdb 2024-07-16T04:17:30,849 copying iotdb/Session.py -> build/lib/iotdb 2024-07-16T04:17:30,853 copying iotdb/IoTDBContainer.py -> build/lib/iotdb 2024-07-16T04:17:30,855 copying iotdb/SessionPool.py -> build/lib/iotdb 2024-07-16T04:17:30,857 creating build/lib/iotdb/template 2024-07-16T04:17:30,858 copying iotdb/template/__init__.py -> build/lib/iotdb/template 2024-07-16T04:17:30,860 copying iotdb/template/TemplateQueryType.py -> build/lib/iotdb/template 2024-07-16T04:17:30,861 copying iotdb/template/Template.py -> build/lib/iotdb/template 2024-07-16T04:17:30,863 copying iotdb/template/MeasurementNode.py -> build/lib/iotdb/template 2024-07-16T04:17:30,865 copying iotdb/template/InternalNode.py -> build/lib/iotdb/template 2024-07-16T04:17:30,866 copying iotdb/template/TemplateNode.py -> build/lib/iotdb/template 2024-07-16T04:17:30,869 creating build/lib/iotdb/utils 2024-07-16T04:17:30,869 copying iotdb/utils/SessionDataSet.py -> build/lib/iotdb/utils 2024-07-16T04:17:30,871 copying iotdb/utils/__init__.py -> build/lib/iotdb/utils 2024-07-16T04:17:30,873 copying iotdb/utils/RowRecord.py -> build/lib/iotdb/utils 2024-07-16T04:17:30,875 copying iotdb/utils/IoTDBRpcDataSet.py -> build/lib/iotdb/utils 2024-07-16T04:17:30,877 copying iotdb/utils/BitMap.py -> build/lib/iotdb/utils 2024-07-16T04:17:30,879 copying iotdb/utils/IoTDBConnectionException.py -> build/lib/iotdb/utils 2024-07-16T04:17:30,880 copying iotdb/utils/IoTDBConstants.py -> build/lib/iotdb/utils 2024-07-16T04:17:30,882 copying iotdb/utils/Field.py -> build/lib/iotdb/utils 2024-07-16T04:17:30,884 copying iotdb/utils/NumpyTablet.py -> build/lib/iotdb/utils 2024-07-16T04:17:30,886 copying iotdb/utils/Tablet.py -> build/lib/iotdb/utils 2024-07-16T04:17:30,888 creating build/lib/iotdb/tsfile 2024-07-16T04:17:30,889 copying iotdb/tsfile/__init__.py -> build/lib/iotdb/tsfile 2024-07-16T04:17:30,891 creating build/lib/iotdb/thrift 2024-07-16T04:17:30,892 copying iotdb/thrift/__init__.py -> build/lib/iotdb/thrift 2024-07-16T04:17:30,894 creating build/lib/iotdb/dbapi 2024-07-16T04:17:30,895 copying iotdb/dbapi/__init__.py -> build/lib/iotdb/dbapi 2024-07-16T04:17:30,896 copying iotdb/dbapi/Connection.py -> build/lib/iotdb/dbapi 2024-07-16T04:17:30,898 copying iotdb/dbapi/Cursor.py -> build/lib/iotdb/dbapi 2024-07-16T04:17:30,900 copying iotdb/dbapi/Exceptions.py -> build/lib/iotdb/dbapi 2024-07-16T04:17:30,902 creating build/lib/iotdb/sqlalchemy 2024-07-16T04:17:30,903 copying iotdb/sqlalchemy/IoTDBDialect.py -> build/lib/iotdb/sqlalchemy 2024-07-16T04:17:30,906 copying iotdb/sqlalchemy/IoTDBTypeCompiler.py -> build/lib/iotdb/sqlalchemy 2024-07-16T04:17:30,907 copying iotdb/sqlalchemy/__init__.py -> build/lib/iotdb/sqlalchemy 2024-07-16T04:17:30,909 copying iotdb/sqlalchemy/IoTDBIdentifierPreparer.py -> build/lib/iotdb/sqlalchemy 2024-07-16T04:17:30,911 copying iotdb/sqlalchemy/IoTDBSQLCompiler.py -> build/lib/iotdb/sqlalchemy 2024-07-16T04:17:30,914 creating build/lib/iotdb/tsfile/utils 2024-07-16T04:17:30,915 copying iotdb/tsfile/utils/Pair.py -> build/lib/iotdb/tsfile/utils 2024-07-16T04:17:30,917 copying iotdb/tsfile/utils/__init__.py -> build/lib/iotdb/tsfile/utils 2024-07-16T04:17:30,919 copying iotdb/tsfile/utils/ReadWriteIOUtils.py -> build/lib/iotdb/tsfile/utils 2024-07-16T04:17:30,922 creating build/lib/iotdb/tsfile/common 2024-07-16T04:17:30,923 copying iotdb/tsfile/common/__init__.py -> build/lib/iotdb/tsfile/common 2024-07-16T04:17:30,925 creating build/lib/iotdb/tsfile/common/constant 2024-07-16T04:17:30,926 copying iotdb/tsfile/common/constant/__init__.py -> build/lib/iotdb/tsfile/common/constant 2024-07-16T04:17:30,928 copying iotdb/tsfile/common/constant/TsFileConstant.py -> build/lib/iotdb/tsfile/common/constant 2024-07-16T04:17:30,930 creating build/lib/iotdb/thrift/rpc 2024-07-16T04:17:30,932 copying iotdb/thrift/rpc/__init__.py -> build/lib/iotdb/thrift/rpc 2024-07-16T04:17:30,934 copying iotdb/thrift/rpc/IClientRPCService.py -> build/lib/iotdb/thrift/rpc 2024-07-16T04:17:30,943 copying iotdb/thrift/rpc/ttypes.py -> build/lib/iotdb/thrift/rpc 2024-07-16T04:17:30,952 copying iotdb/thrift/rpc/constants.py -> build/lib/iotdb/thrift/rpc 2024-07-16T04:17:30,954 creating build/lib/iotdb/thrift/common 2024-07-16T04:17:30,955 copying iotdb/thrift/common/__init__.py -> build/lib/iotdb/thrift/common 2024-07-16T04:17:30,958 copying iotdb/thrift/common/ttypes.py -> build/lib/iotdb/thrift/common 2024-07-16T04:17:30,961 copying iotdb/thrift/common/constants.py -> build/lib/iotdb/thrift/common 2024-07-16T04:17:30,964 creating build/lib/iotdb/dbapi/tests 2024-07-16T04:17:30,965 copying iotdb/dbapi/tests/__init__.py -> build/lib/iotdb/dbapi/tests 2024-07-16T04:17:30,967 copying iotdb/dbapi/tests/test_cursor.py -> build/lib/iotdb/dbapi/tests 2024-07-16T04:17:30,969 copying iotdb/dbapi/tests/test_connection.py -> build/lib/iotdb/dbapi/tests 2024-07-16T04:17:30,972 creating build/lib/iotdb/sqlalchemy/tests 2024-07-16T04:17:30,973 copying iotdb/sqlalchemy/tests/__init__.py -> build/lib/iotdb/sqlalchemy/tests 2024-07-16T04:17:30,975 copying iotdb/sqlalchemy/tests/test_dialect.py -> build/lib/iotdb/sqlalchemy/tests 2024-07-16T04:17:31,003 installing to build/bdist.linux-armv7l/wheel 2024-07-16T04:17:31,004 running install 2024-07-16T04:17:31,030 running install_lib 2024-07-16T04:17:31,037 creating build/bdist.linux-armv7l 2024-07-16T04:17:31,038 creating build/bdist.linux-armv7l/wheel 2024-07-16T04:17:31,039 creating build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,041 copying build/lib/tests/tablet_performance_comparison.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,043 copying build/lib/tests/__init__.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,046 copying build/lib/tests/test_delete_data.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,048 copying build/lib/tests/test_session.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,050 copying build/lib/tests/test_dataframe.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,052 copying build/lib/tests/test_session_pool.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,055 copying build/lib/tests/test_numpy_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,057 copying build/lib/tests/test_todf.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,059 copying build/lib/tests/test_tablet.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,062 copying build/lib/tests/test_one_device.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,064 copying build/lib/tests/test_template.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,066 copying build/lib/tests/test_aligned_timeseries.py -> build/bdist.linux-armv7l/wheel/tests 2024-07-16T04:17:31,069 creating build/bdist.linux-armv7l/wheel/iotdb 2024-07-16T04:17:31,070 copying build/lib/iotdb/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-07-16T04:17:31,072 creating build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-16T04:17:31,073 copying build/lib/iotdb/template/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-16T04:17:31,075 copying build/lib/iotdb/template/TemplateQueryType.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-16T04:17:31,077 copying build/lib/iotdb/template/Template.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-16T04:17:31,078 copying build/lib/iotdb/template/MeasurementNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-16T04:17:31,080 copying build/lib/iotdb/template/InternalNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-16T04:17:31,082 copying build/lib/iotdb/template/TemplateNode.py -> build/bdist.linux-armv7l/wheel/iotdb/template 2024-07-16T04:17:31,084 creating build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,085 copying build/lib/iotdb/utils/SessionDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,087 copying build/lib/iotdb/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,088 copying build/lib/iotdb/utils/RowRecord.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,090 copying build/lib/iotdb/utils/IoTDBRpcDataSet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,092 copying build/lib/iotdb/utils/BitMap.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,094 copying build/lib/iotdb/utils/IoTDBConnectionException.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,096 copying build/lib/iotdb/utils/IoTDBConstants.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,097 copying build/lib/iotdb/utils/Field.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,099 copying build/lib/iotdb/utils/NumpyTablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,102 copying build/lib/iotdb/utils/Tablet.py -> build/bdist.linux-armv7l/wheel/iotdb/utils 2024-07-16T04:17:31,104 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile 2024-07-16T04:17:31,105 copying build/lib/iotdb/tsfile/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile 2024-07-16T04:17:31,107 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-07-16T04:17:31,108 copying build/lib/iotdb/tsfile/utils/Pair.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-07-16T04:17:31,110 copying build/lib/iotdb/tsfile/utils/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-07-16T04:17:31,111 copying build/lib/iotdb/tsfile/utils/ReadWriteIOUtils.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/utils 2024-07-16T04:17:31,113 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/common 2024-07-16T04:17:31,115 creating build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2024-07-16T04:17:31,116 copying build/lib/iotdb/tsfile/common/constant/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2024-07-16T04:17:31,117 copying build/lib/iotdb/tsfile/common/constant/TsFileConstant.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common/constant 2024-07-16T04:17:31,119 copying build/lib/iotdb/tsfile/common/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/tsfile/common 2024-07-16T04:17:31,121 creating build/bdist.linux-armv7l/wheel/iotdb/thrift 2024-07-16T04:17:31,122 copying build/lib/iotdb/thrift/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift 2024-07-16T04:17:31,124 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-07-16T04:17:31,125 copying build/lib/iotdb/thrift/rpc/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-07-16T04:17:31,126 copying build/lib/iotdb/thrift/rpc/IClientRPCService.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-07-16T04:17:31,137 copying build/lib/iotdb/thrift/rpc/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-07-16T04:17:31,146 copying build/lib/iotdb/thrift/rpc/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/rpc 2024-07-16T04:17:31,148 creating build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-07-16T04:17:31,149 copying build/lib/iotdb/thrift/common/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-07-16T04:17:31,150 copying build/lib/iotdb/thrift/common/ttypes.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-07-16T04:17:31,154 copying build/lib/iotdb/thrift/common/constants.py -> build/bdist.linux-armv7l/wheel/iotdb/thrift/common 2024-07-16T04:17:31,155 copying build/lib/iotdb/Session.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-07-16T04:17:31,159 copying build/lib/iotdb/IoTDBContainer.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-07-16T04:17:31,162 creating build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-07-16T04:17:31,162 copying build/lib/iotdb/dbapi/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-07-16T04:17:31,165 creating build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-07-16T04:17:31,166 copying build/lib/iotdb/dbapi/tests/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-07-16T04:17:31,167 copying build/lib/iotdb/dbapi/tests/test_cursor.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-07-16T04:17:31,169 copying build/lib/iotdb/dbapi/tests/test_connection.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi/tests 2024-07-16T04:17:31,171 copying build/lib/iotdb/dbapi/Connection.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-07-16T04:17:31,173 copying build/lib/iotdb/dbapi/Cursor.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-07-16T04:17:31,175 copying build/lib/iotdb/dbapi/Exceptions.py -> build/bdist.linux-armv7l/wheel/iotdb/dbapi 2024-07-16T04:17:31,177 copying build/lib/iotdb/SessionPool.py -> build/bdist.linux-armv7l/wheel/iotdb 2024-07-16T04:17:31,179 creating build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-16T04:17:31,180 copying build/lib/iotdb/sqlalchemy/IoTDBDialect.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-16T04:17:31,182 copying build/lib/iotdb/sqlalchemy/IoTDBTypeCompiler.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-16T04:17:31,184 copying build/lib/iotdb/sqlalchemy/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-16T04:17:31,186 copying build/lib/iotdb/sqlalchemy/IoTDBIdentifierPreparer.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-16T04:17:31,188 creating build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2024-07-16T04:17:31,189 copying build/lib/iotdb/sqlalchemy/tests/__init__.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2024-07-16T04:17:31,190 copying build/lib/iotdb/sqlalchemy/tests/test_dialect.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy/tests 2024-07-16T04:17:31,192 copying build/lib/iotdb/sqlalchemy/IoTDBSQLCompiler.py -> build/bdist.linux-armv7l/wheel/iotdb/sqlalchemy 2024-07-16T04:17:31,194 running install_egg_info 2024-07-16T04:17:31,204 running egg_info 2024-07-16T04:17:31,210 writing apache_iotdb.egg-info/PKG-INFO 2024-07-16T04:17:31,214 writing dependency_links to apache_iotdb.egg-info/dependency_links.txt 2024-07-16T04:17:31,216 writing entry points to apache_iotdb.egg-info/entry_points.txt 2024-07-16T04:17:31,217 writing requirements to apache_iotdb.egg-info/requires.txt 2024-07-16T04:17:31,218 writing top-level names to apache_iotdb.egg-info/top_level.txt 2024-07-16T04:17:31,238 reading manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-07-16T04:17:31,246 writing manifest file 'apache_iotdb.egg-info/SOURCES.txt' 2024-07-16T04:17:31,247 Copying apache_iotdb.egg-info to build/bdist.linux-armv7l/wheel/apache_iotdb-1.3.2.post0-py3.9.egg-info 2024-07-16T04:17:31,259 running install_scripts 2024-07-16T04:17:31,279 creating build/bdist.linux-armv7l/wheel/apache_iotdb-1.3.2.post0.dist-info/WHEEL 2024-07-16T04:17:31,281 creating '/tmp/pip-wheel-oo7oj12s/.tmp-n105xl2q/apache_iotdb-1.3.2.post0-py3-none-any.whl' and adding 'build/bdist.linux-armv7l/wheel' to it 2024-07-16T04:17:31,285 adding 'iotdb/IoTDBContainer.py' 2024-07-16T04:17:31,291 adding 'iotdb/Session.py' 2024-07-16T04:17:31,294 adding 'iotdb/SessionPool.py' 2024-07-16T04:17:31,295 adding 'iotdb/__init__.py' 2024-07-16T04:17:31,297 adding 'iotdb/dbapi/Connection.py' 2024-07-16T04:17:31,298 adding 'iotdb/dbapi/Cursor.py' 2024-07-16T04:17:31,300 adding 'iotdb/dbapi/Exceptions.py' 2024-07-16T04:17:31,301 adding 'iotdb/dbapi/__init__.py' 2024-07-16T04:17:31,303 adding 'iotdb/dbapi/tests/__init__.py' 2024-07-16T04:17:31,304 adding 'iotdb/dbapi/tests/test_connection.py' 2024-07-16T04:17:31,305 adding 'iotdb/dbapi/tests/test_cursor.py' 2024-07-16T04:17:31,307 adding 'iotdb/sqlalchemy/IoTDBDialect.py' 2024-07-16T04:17:31,309 adding 'iotdb/sqlalchemy/IoTDBIdentifierPreparer.py' 2024-07-16T04:17:31,311 adding 'iotdb/sqlalchemy/IoTDBSQLCompiler.py' 2024-07-16T04:17:31,312 adding 'iotdb/sqlalchemy/IoTDBTypeCompiler.py' 2024-07-16T04:17:31,313 adding 'iotdb/sqlalchemy/__init__.py' 2024-07-16T04:17:31,315 adding 'iotdb/sqlalchemy/tests/__init__.py' 2024-07-16T04:17:31,316 adding 'iotdb/sqlalchemy/tests/test_dialect.py' 2024-07-16T04:17:31,318 adding 'iotdb/template/InternalNode.py' 2024-07-16T04:17:31,319 adding 'iotdb/template/MeasurementNode.py' 2024-07-16T04:17:31,320 adding 'iotdb/template/Template.py' 2024-07-16T04:17:31,322 adding 'iotdb/template/TemplateNode.py' 2024-07-16T04:17:31,323 adding 'iotdb/template/TemplateQueryType.py' 2024-07-16T04:17:31,324 adding 'iotdb/template/__init__.py' 2024-07-16T04:17:31,326 adding 'iotdb/thrift/__init__.py' 2024-07-16T04:17:31,327 adding 'iotdb/thrift/common/__init__.py' 2024-07-16T04:17:31,328 adding 'iotdb/thrift/common/constants.py' 2024-07-16T04:17:31,333 adding 'iotdb/thrift/common/ttypes.py' 2024-07-16T04:17:31,348 adding 'iotdb/thrift/rpc/IClientRPCService.py' 2024-07-16T04:17:31,352 adding 'iotdb/thrift/rpc/__init__.py' 2024-07-16T04:17:31,353 adding 'iotdb/thrift/rpc/constants.py' 2024-07-16T04:17:31,367 adding 'iotdb/thrift/rpc/ttypes.py' 2024-07-16T04:17:31,370 adding 'iotdb/tsfile/__init__.py' 2024-07-16T04:17:31,372 adding 'iotdb/tsfile/common/__init__.py' 2024-07-16T04:17:31,374 adding 'iotdb/tsfile/common/constant/TsFileConstant.py' 2024-07-16T04:17:31,375 adding 'iotdb/tsfile/common/constant/__init__.py' 2024-07-16T04:17:31,377 adding 'iotdb/tsfile/utils/Pair.py' 2024-07-16T04:17:31,378 adding 'iotdb/tsfile/utils/ReadWriteIOUtils.py' 2024-07-16T04:17:31,379 adding 'iotdb/tsfile/utils/__init__.py' 2024-07-16T04:17:31,381 adding 'iotdb/utils/BitMap.py' 2024-07-16T04:17:31,382 adding 'iotdb/utils/Field.py' 2024-07-16T04:17:31,384 adding 'iotdb/utils/IoTDBConnectionException.py' 2024-07-16T04:17:31,385 adding 'iotdb/utils/IoTDBConstants.py' 2024-07-16T04:17:31,387 adding 'iotdb/utils/IoTDBRpcDataSet.py' 2024-07-16T04:17:31,389 adding 'iotdb/utils/NumpyTablet.py' 2024-07-16T04:17:31,390 adding 'iotdb/utils/RowRecord.py' 2024-07-16T04:17:31,392 adding 'iotdb/utils/SessionDataSet.py' 2024-07-16T04:17:31,393 adding 'iotdb/utils/Tablet.py' 2024-07-16T04:17:31,395 adding 'iotdb/utils/__init__.py' 2024-07-16T04:17:31,396 adding 'tests/__init__.py' 2024-07-16T04:17:31,398 adding 'tests/tablet_performance_comparison.py' 2024-07-16T04:17:31,400 adding 'tests/test_aligned_timeseries.py' 2024-07-16T04:17:31,401 adding 'tests/test_dataframe.py' 2024-07-16T04:17:31,403 adding 'tests/test_delete_data.py' 2024-07-16T04:17:31,404 adding 'tests/test_numpy_tablet.py' 2024-07-16T04:17:31,406 adding 'tests/test_one_device.py' 2024-07-16T04:17:31,408 adding 'tests/test_session.py' 2024-07-16T04:17:31,409 adding 'tests/test_session_pool.py' 2024-07-16T04:17:31,411 adding 'tests/test_tablet.py' 2024-07-16T04:17:31,412 adding 'tests/test_template.py' 2024-07-16T04:17:31,414 adding 'tests/test_todf.py' 2024-07-16T04:17:31,416 adding 'apache_iotdb-1.3.2.post0.dist-info/METADATA' 2024-07-16T04:17:31,417 adding 'apache_iotdb-1.3.2.post0.dist-info/WHEEL' 2024-07-16T04:17:31,418 adding 'apache_iotdb-1.3.2.post0.dist-info/entry_points.txt' 2024-07-16T04:17:31,419 adding 'apache_iotdb-1.3.2.post0.dist-info/top_level.txt' 2024-07-16T04:17:31,421 adding 'apache_iotdb-1.3.2.post0.dist-info/RECORD' 2024-07-16T04:17:31,426 removing build/bdist.linux-armv7l/wheel 2024-07-16T04:17:31,522 Building wheel for apache-iotdb (pyproject.toml): finished with status 'done' 2024-07-16T04:17:31,529 Created wheel for apache-iotdb: filename=apache_iotdb-1.3.2.post0-py3-none-any.whl size=128471 sha256=96845da960bb3a1d4220edad6cc35ee4b9a453de891ba1214881c9b5339c390b 2024-07-16T04:17:31,530 Stored in directory: /tmp/pip-ephem-wheel-cache-02uvxzat/wheels/c4/2e/ec/0d35a35a8188a0e0a144d22363213157a285ef7c5a77e6c133 2024-07-16T04:17:31,546 Successfully built apache-iotdb 2024-07-16T04:17:31,551 Removed build tracker: '/tmp/pip-build-tracker-zljf12zd'