jt2594838 commented on code in PR #17801:
URL: https://github.com/apache/iotdb/pull/17801#discussion_r3340622103


##########
iotdb-client/client-cpp/src/session/Date.cpp:
##########
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "Date.h"
+
+#include <climits>
+#include <cstdio>
+#include <string>
+
+#include "Common.h"
+
+std::string IoTDBDate::toIsoExtendedString() const {
+  if (!valid_) {
+    return "";
+  }
+  char buf[16];
+  std::snprintf(buf, sizeof(buf), "%04d-%02d-%02d", year_, month_, day_);
+  return std::string(buf);
+}

Review Comment:
   Where is the valid_ from? Is it thread local?



##########
iotdb-client/client-cpp/src/session/Common.cpp:
##########


Review Comment:
   Why not just remove the unused parameters?



##########
iotdb-client/client-cpp/src/session/Date.cpp:
##########
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include "Date.h"
+
+#include <climits>
+#include <cstdio>
+#include <string>
+
+#include "Common.h"
+
+std::string IoTDBDate::toIsoExtendedString() const {
+  if (!valid_) {
+    return "";
+  }
+  char buf[16];
+  std::snprintf(buf, sizeof(buf), "%04d-%02d-%02d", year_, month_, day_);
+  return std::string(buf);
+}
+
+int32_t parseDateExpressionToInt(const IoTDBDate& date) {
+  if (date.is_not_a_date()) {
+    throw IoTDBException("Date expression is null or empty.");
+  }
+
+  const int year = date.year();
+  if (year < 1000 || year > 9999) {
+    throw DateTimeParseException("Year must be between 1000 and 9999.", 
date.toIsoExtendedString(),
+                                 0);
+  }
+
+  const int64_t result = static_cast<int64_t>(year) * 10000 + date.month() * 
100 + date.day();
+  if (result > INT32_MAX || result < INT32_MIN) {
+    throw DateTimeParseException("Date value overflow. ", 
date.toIsoExtendedString(), 0);
+  }

Review Comment:
   Necessary to check month and day?



##########
.github/scripts/package-client-cpp-manylinux-glibc224.sh:
##########


Review Comment:
   What is the main difference between the two scripts?
   
   Or, what made the compilation so different between 2.17 and 2.24? Is it 
possible to extract something in common?



##########
example/client-cpp-example/README.md:
##########
@@ -19,30 +19,244 @@
 
 -->
 
-# How to get a complete CPP client demo project
+# IoTDB C++ client examples
 
-## Get a project
+[中文说明](README_zh.md)
 
-Using maven to build this example project:
+Sample programs that link against the pre-built **IoTDB C++ Session SDK**
+(`iotdb_session`). Thrift and Boost are **not** required at application compile
+time; they are embedded inside the SDK shared library.
 
-* cd the root path of the whole project
-* run `mvn clean package -DskipTests -P with-cpp -pl 
example/client-cpp-example -am`
-* cd example/client-cpp-example/target
+All examples connect to a running IoTDB instance (default `127.0.0.1:6667`,
+user `root` / `root`).
+
+| Example | Description |
+|---------|-------------|
+| `SessionExample` | Tree model: DDL, insert, query, delete |
+| `AlignedTimeseriesSessionExample` | Aligned time series and templates |
+| `TableModelSessionExample` | Table (relational) model |
+| `MultiSvrNodeClient` | Multi-node insert/query loop |
+| `tree_example` | C Session API (tree model) |
+| `table_example` | C Session API (table model) |
+
+## Which SDK zip to use
+
+Release CI 
([client-cpp-package.yml](../../.github/workflows/client-cpp-package.yml))
+publishes one zip per platform/toolchain:
+`client-cpp-<version>-<classifier>.zip` (zip root contains `include/` and 
`lib/`).
+
+| Deployment target | Classifier suffix |
+|-------------------|-------------------|
+| Linux x86_64, glibc ≥ 2.24, CXX11 ABI (**recommended**) | 
`linux-x86_64-glibc224` |
+| Linux aarch64, glibc ≥ 2.24, CXX11 ABI (**recommended**) | 
`linux-aarch64-glibc224` |
+| Linux x86_64, glibc ≥ 2.17, legacy ABI | `linux-x86_64-glibc217` |
+| Linux aarch64, glibc ≥ 2.17, legacy ABI | `linux-aarch64-glibc217` |
+| macOS x86_64 | `mac-x86_64` |
+| macOS arm64 | `mac-aarch64` |
+| Windows (match your Visual Studio version) | `windows-x86_64-vs2017` … 
`vs2026` |
+
+The current build compiles Thrift 0.21 from source at CMake configure time.
+Legacy `-Diotdb-tools-thrift.version=...` flags applied to the **old**
+pre-built Thrift workflow only. On Linux, prefer **`glibc224`** when your host 
has
+glibc ≥ 2.24 and you use the default `g++`. Use **`glibc217`** only for glibc 
2.17
+systems or legacy ABI; on Ubuntu 22/24 you may need 
`-D_GLIBCXX_USE_CXX11_ABI=0`
+when linking against `glibc217`. See [client-cpp 
README](../../iotdb-client/client-cpp/README.md).
+
+## SDK layout (after unpack)
+
+The SDK zip produced by `client-cpp` contains **public headers only** and one
+shared library:
+
+```
+client/
+├── include/
+│   ├── Session.h
+│   ├── Export.h
+│   └── ...          (17 public headers; no thrift/ or boost/)

Review Comment:
   No need to mention `no thrift/ or boost/` any more.
   
   New users should be free from the two words.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to