You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by is...@apache.org on 2023/08/22 14:28:26 UTC

[ignite-3] branch ignite-19983 created (now f7c565dbcf)

This is an automated email from the ASF dual-hosted git repository.

isapego pushed a change to branch ignite-19983
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


      at f7c565dbcf IGNITE-19983 SQL tests

This branch includes the following new commits:

     new 00e712dcb9 IGNITE-19983 Added bool writing
     new 54d95cf07a IGNITE-19983 Table tests
     new f7c565dbcf IGNITE-19983 SQL tests

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[ignite-3] 03/03: IGNITE-19983 SQL tests

Posted by is...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

isapego pushed a commit to branch ignite-19983
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit f7c565dbcf7e4ea436ba687da3f633c7badb05a1
Author: Igor Sapego <is...@apache.org>
AuthorDate: Tue Aug 22 18:27:51 2023 +0400

    IGNITE-19983 SQL tests
---
 modules/platforms/cpp/ignite/protocol/utils.cpp                    | 4 ++--
 modules/platforms/cpp/tests/client-test/sql_test.cpp               | 7 ++++---
 .../apache/ignite/internal/runner/app/PlatformTestNodeRunner.java  | 6 ++++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/modules/platforms/cpp/ignite/protocol/utils.cpp b/modules/platforms/cpp/ignite/protocol/utils.cpp
index 1740667aae..184cd45d86 100644
--- a/modules/platforms/cpp/ignite/protocol/utils.cpp
+++ b/modules/platforms/cpp/ignite/protocol/utils.cpp
@@ -213,7 +213,7 @@ void claim_primitive_with_type(binary_tuple_builder &builder, const primitive &v
 
     switch (value.get_type()) {
         case ignite_type::BOOLEAN: {
-            claim_type_and_scale(builder, ignite_type::INT8);
+            claim_type_and_scale(builder, ignite_type::BOOLEAN);
             builder.claim_bool(value.get<bool>());
             break;
         }
@@ -324,7 +324,7 @@ void append_primitive_with_type(binary_tuple_builder &builder, const primitive &
 
     switch (value.get_type()) {
         case ignite_type::BOOLEAN: {
-            append_type_and_scale(builder, ignite_type::INT8);
+            append_type_and_scale(builder, ignite_type::BOOLEAN);
             builder.append_bool(value.get<bool>());
             break;
         }
diff --git a/modules/platforms/cpp/tests/client-test/sql_test.cpp b/modules/platforms/cpp/tests/client-test/sql_test.cpp
index 158831c9b5..1c09418b2d 100644
--- a/modules/platforms/cpp/tests/client-test/sql_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/sql_test.cpp
@@ -45,14 +45,14 @@ protected:
         }
 
         client.get_sql().execute(nullptr,
-            {"INSERT INTO TBL_ALL_COLUMNS_SQL VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"},
+            {"INSERT INTO TBL_ALL_COLUMNS_SQL VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"},
             {std::int64_t(42), std::string("test"), std::int8_t(1), std::int16_t(2), std::int32_t(3), std::int64_t(4),
                 .5f, .6, uuid(0x123e4567e89b12d3, 0x7456426614174000), ignite_date(2023, 2, 7),
                 ignite_time(17, 4, 12, 3543634), ignite_time(17, 4, 12, 3543634),
                 ignite_date_time({2020, 7, 28}, {2, 15, 52, 6349879}),
                 ignite_date_time({2020, 7, 28}, {2, 15, 52, 6349879}), ignite_timestamp(3875238472, 248760634),
                 ignite_timestamp(3875238472, 248760634),
-                std::vector<std::byte>{std::byte(1), std::byte(2), std::byte(42)}, big_decimal(123456789098765)});
+                std::vector<std::byte>{std::byte(1), std::byte(2), std::byte(42)}, big_decimal(123456789098765), true});
     }
 
     static void TearDownTestSuite() {
@@ -350,7 +350,7 @@ TEST_F(sql_test, decimal_literal) {
 TEST_F(sql_test, all_type_arguments) {
     auto result_set = m_client.get_sql().execute(nullptr,
         {"select str,int8,int16,int32,int64,float,double,uuid,date,\"TIME\",time2,"
-         "\"DATETIME\",datetime2,timestamp,timestamp2,blob,decimal from TBL_ALL_COLUMNS_SQL"},
+         "\"DATETIME\",datetime2,timestamp,timestamp2,blob,decimal,boolean from TBL_ALL_COLUMNS_SQL"},
         {});
 
     EXPECT_TRUE(result_set.has_rowset());
@@ -372,6 +372,7 @@ TEST_F(sql_test, all_type_arguments) {
     EXPECT_EQ(row.get(13).get<ignite_timestamp>(), ignite_timestamp(3875238472, 248000000));
     EXPECT_EQ(row.get(14).get<ignite_timestamp>(), ignite_timestamp(3875238472, 248000000));
     EXPECT_EQ(row.get(16).get<big_decimal>(), big_decimal(123456789098765));
+    EXPECT_EQ(row.get(17).get<bool>(), true);
 
     auto blob = row.get(15).get<std::vector<std::byte>>();
     EXPECT_EQ(blob[0], std::byte(1));
diff --git a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
index ca7e03065a..211ce992ed 100644
--- a/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
+++ b/modules/runner/src/integrationTest/java/org/apache/ignite/internal/runner/app/PlatformTestNodeRunner.java
@@ -292,7 +292,8 @@ public class PlatformTestNodeRunner {
                 SchemaBuilders.column("timestamp", ColumnType.timestamp(maxTimePrecision)).asNullable(true).build(),
                 SchemaBuilders.column("timestamp2", ColumnType.timestamp(4)).asNullable(true).build(),
                 SchemaBuilders.column("blob", ColumnType.blob()).asNullable(true).build(),
-                SchemaBuilders.column("decimal", ColumnType.decimal()).asNullable(true).build()
+                SchemaBuilders.column("decimal", ColumnType.decimal()).asNullable(true).build(),
+                SchemaBuilders.column("boolean", ColumnType.BOOLEAN).asNullable(true).build()
         ).withPrimaryKey(keyCol).build();
 
         await(((TableManager) node.tables()).createTableAsync(schTblAll.name(), ZONE_NAME, tblCh ->
@@ -318,7 +319,8 @@ public class PlatformTestNodeRunner {
                 SchemaBuilders.column("timestamp", ColumnType.timestamp(maxTimePrecision)).asNullable(true).build(),
                 SchemaBuilders.column("timestamp2", ColumnType.timestamp(maxTimePrecision)).asNullable(true).build(),
                 SchemaBuilders.column("blob", ColumnType.blob()).asNullable(true).build(),
-                SchemaBuilders.column("decimal", ColumnType.decimal()).asNullable(true).build()
+                SchemaBuilders.column("decimal", ColumnType.decimal()).asNullable(true).build(),
+                SchemaBuilders.column("boolean", ColumnType.BOOLEAN).asNullable(true).build()
         ).withPrimaryKey(keyCol).build();
 
         await(((TableManager) node.tables()).createTableAsync(schTblAllSql.name(), ZONE_NAME, tblCh ->


[ignite-3] 01/03: IGNITE-19983 Added bool writing

Posted by is...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

isapego pushed a commit to branch ignite-19983
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit 00e712dcb99ffedd8b02209effb1b70f05f3172b
Author: Igor Sapego <is...@apache.org>
AuthorDate: Tue Aug 22 17:50:06 2023 +0400

    IGNITE-19983 Added bool writing
---
 modules/platforms/cpp/ignite/client/detail/utils.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/platforms/cpp/ignite/client/detail/utils.cpp b/modules/platforms/cpp/ignite/client/detail/utils.cpp
index 0be8047efa..5a7e06111e 100644
--- a/modules/platforms/cpp/ignite/client/detail/utils.cpp
+++ b/modules/platforms/cpp/ignite/client/detail/utils.cpp
@@ -35,6 +35,9 @@ namespace ignite::detail {
  */
 void claim_column(binary_tuple_builder &builder, ignite_type typ, const primitive &value, std::int32_t scale) {
     switch (typ) {
+        case ignite_type::BOOLEAN:
+            builder.claim_bool(value.get<bool>());
+            break;
         case ignite_type::INT8:
             builder.claim_int8(value.get<std::int8_t>());
             break;
@@ -107,6 +110,9 @@ void claim_column(binary_tuple_builder &builder, ignite_type typ, const primitiv
  */
 void append_column(binary_tuple_builder &builder, ignite_type typ, const primitive &value, std::int32_t scale) {
     switch (typ) {
+        case ignite_type::BOOLEAN:
+            builder.append_bool(value.get<bool>());
+            break;
         case ignite_type::INT8:
             builder.append_int8(value.get<std::int8_t>());
             break;


[ignite-3] 02/03: IGNITE-19983 Table tests

Posted by is...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

isapego pushed a commit to branch ignite-19983
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit 54d95cf07aa88266bef48ea3a361b56c56cd150d
Author: Igor Sapego <is...@apache.org>
AuthorDate: Tue Aug 22 18:19:22 2023 +0400

    IGNITE-19983 Table tests
---
 modules/platforms/cpp/tests/client-test/all_fields_type.h              | 3 +++
 modules/platforms/cpp/tests/client-test/key_value_binary_view_test.cpp | 1 +
 modules/platforms/cpp/tests/client-test/key_value_view_test.cpp        | 2 ++
 modules/platforms/cpp/tests/client-test/record_binary_view_test.cpp    | 1 +
 modules/platforms/cpp/tests/client-test/record_view_test.cpp           | 2 ++
 5 files changed, 9 insertions(+)

diff --git a/modules/platforms/cpp/tests/client-test/all_fields_type.h b/modules/platforms/cpp/tests/client-test/all_fields_type.h
index e5cb2c313e..d1b808a39d 100644
--- a/modules/platforms/cpp/tests/client-test/all_fields_type.h
+++ b/modules/platforms/cpp/tests/client-test/all_fields_type.h
@@ -59,6 +59,7 @@ struct all_fields_type {
     ignite::ignite_timestamp m_timestamp2;
     std::vector<std::byte> m_blob;
     ignite::big_decimal m_decimal;
+    bool m_boolean{false};
 };
 
 namespace ignite {
@@ -86,6 +87,7 @@ inline ignite_tuple convert_to_tuple(all_fields_type &&value) {
     tuple.set("timestamp2", value.m_timestamp2);
     tuple.set("blob", value.m_blob);
     tuple.set("decimal", value.m_decimal);
+    tuple.set("boolean", value.m_boolean);
 
     return tuple;
 }
@@ -115,6 +117,7 @@ inline all_fields_type convert_from_tuple(ignite_tuple &&value) {
         res.m_timestamp2 = value.get<ignite_timestamp>("timestamp2");
         res.m_blob = value.get<std::vector<std::byte>>("blob");
         res.m_decimal = value.get<big_decimal>("decimal");
+        res.m_boolean = value.get<bool>("boolean");
     }
 
     return res;
diff --git a/modules/platforms/cpp/tests/client-test/key_value_binary_view_test.cpp b/modules/platforms/cpp/tests/client-test/key_value_binary_view_test.cpp
index 30930c8066..43fe96213f 100644
--- a/modules/platforms/cpp/tests/client-test/key_value_binary_view_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/key_value_binary_view_test.cpp
@@ -959,6 +959,7 @@ TEST_F(key_value_binary_view_test, types_test) {
         {"timestamp2", ignite_timestamp(3875238472, 248760634)},
         {"blob", std::vector<std::byte>{std::byte(1), std::byte(2), std::byte(42)}},
         {"decimal", big_decimal(123456789098765)},
+        {"boolean", true},
     };
 
     kv_view.put(nullptr, get_tuple(42), inserted);
diff --git a/modules/platforms/cpp/tests/client-test/key_value_view_test.cpp b/modules/platforms/cpp/tests/client-test/key_value_view_test.cpp
index 46101841d8..3d0c5d4bc9 100644
--- a/modules/platforms/cpp/tests/client-test/key_value_view_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/key_value_view_test.cpp
@@ -811,6 +811,7 @@ TEST_F(key_value_view_test, types_test) {
     inserted.m_timestamp2 = {3875238472, 248760634};
     inserted.m_blob = {std::byte(1), std::byte(2), std::byte(42)};
     inserted.m_decimal = big_decimal{123456789098765};
+    inserted.m_boolean = true;
 
     kv_view.put(nullptr, test_key_type(42), inserted);
     auto res = kv_view.get(nullptr, test_key_type(42));
@@ -833,6 +834,7 @@ TEST_F(key_value_view_test, types_test) {
     EXPECT_EQ(inserted.m_timestamp, res->m_timestamp);
     EXPECT_EQ(inserted.m_blob, res->m_blob);
     EXPECT_EQ(inserted.m_decimal, res->m_decimal);
+    EXPECT_EQ(inserted.m_boolean, res->m_boolean);
 
     EXPECT_EQ(ignite_time(17, 4, 12), res->m_time2);
     EXPECT_EQ(ignite_date_time({2020, 7, 28}, {2, 15, 52, 6000000}), res->m_datetime2);
diff --git a/modules/platforms/cpp/tests/client-test/record_binary_view_test.cpp b/modules/platforms/cpp/tests/client-test/record_binary_view_test.cpp
index b2376df3c1..d9e29325dc 100644
--- a/modules/platforms/cpp/tests/client-test/record_binary_view_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/record_binary_view_test.cpp
@@ -967,6 +967,7 @@ TEST_F(record_binary_view_test, types_test) {
         {"timestamp2", ignite_timestamp(3875238472, 248760634)},
         {"blob", std::vector<std::byte>{std::byte(1), std::byte(2), std::byte(42)}},
         {"decimal", big_decimal(123456789098765)},
+        {"boolean", true},
     };
 
     tuple_view.upsert(nullptr, inserted);
diff --git a/modules/platforms/cpp/tests/client-test/record_view_test.cpp b/modules/platforms/cpp/tests/client-test/record_view_test.cpp
index e3062a675c..995b2b052b 100644
--- a/modules/platforms/cpp/tests/client-test/record_view_test.cpp
+++ b/modules/platforms/cpp/tests/client-test/record_view_test.cpp
@@ -988,6 +988,7 @@ TEST_F(record_view_test, types_test) {
     inserted.m_timestamp2 = {3875238472, 248760634};
     inserted.m_blob = {std::byte(1), std::byte(2), std::byte(42)};
     inserted.m_decimal = big_decimal{123456789098765};
+    inserted.m_boolean = true;
 
     view2.upsert(nullptr, inserted);
     auto res = view2.get(nullptr, all_fields_type{42});
@@ -1010,6 +1011,7 @@ TEST_F(record_view_test, types_test) {
     EXPECT_EQ(inserted.m_timestamp, res->m_timestamp);
     EXPECT_EQ(inserted.m_blob, res->m_blob);
     EXPECT_EQ(inserted.m_decimal, res->m_decimal);
+    EXPECT_EQ(inserted.m_boolean, res->m_boolean);
 
     EXPECT_EQ(ignite_time(17, 4, 12), res->m_time2);
     EXPECT_EQ(ignite_date_time({2020, 7, 28}, {2, 15, 52, 6000000}), res->m_datetime2);