You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2020/04/16 15:39:17 UTC

[incubator-doris] branch master updated: [SegmentV1] Enable to read and write boolean type data (#3324)

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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 224f5d8  [SegmentV1] Enable to read and write boolean type data (#3324)
224f5d8 is described below

commit 224f5d8badacd77d180a567da7f75e33221242b3
Author: caiconghui <55...@users.noreply.github.com>
AuthorDate: Thu Apr 16 10:39:08 2020 -0500

    [SegmentV1] Enable to read and write boolean type data (#3324)
    
    This PR is to enable to read and write boolean type data for segment v1
---
 be/src/olap/rowset/column_reader.cpp                      | 1 +
 be/src/olap/rowset/column_writer.cpp                      | 1 +
 fe/src/main/java/org/apache/doris/catalog/ScalarType.java | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/be/src/olap/rowset/column_reader.cpp b/be/src/olap/rowset/column_reader.cpp
index 9583baa..a6bc085 100644
--- a/be/src/olap/rowset/column_reader.cpp
+++ b/be/src/olap/rowset/column_reader.cpp
@@ -547,6 +547,7 @@ ColumnReader* ColumnReader::create(uint32_t column_id,
     }
 
     switch (column.type()) {
+    case OLAP_FIELD_TYPE_BOOL:
     case OLAP_FIELD_TYPE_TINYINT:
     case OLAP_FIELD_TYPE_UNSIGNED_TINYINT: {
         reader = new(std::nothrow) TinyColumnReader(column_id, column_unique_id);
diff --git a/be/src/olap/rowset/column_writer.cpp b/be/src/olap/rowset/column_writer.cpp
index 7551116..f2ab991 100755
--- a/be/src/olap/rowset/column_writer.cpp
+++ b/be/src/olap/rowset/column_writer.cpp
@@ -31,6 +31,7 @@ ColumnWriter* ColumnWriter::create(uint32_t column_id,
     const TabletColumn& column = schema.column(column_id);
 
     switch (column.type()) {
+    case OLAP_FIELD_TYPE_BOOL:
     case OLAP_FIELD_TYPE_TINYINT:
     case OLAP_FIELD_TYPE_UNSIGNED_TINYINT: {
         column_writer = new(std::nothrow) ByteColumnWriter(column_id,
diff --git a/fe/src/main/java/org/apache/doris/catalog/ScalarType.java b/fe/src/main/java/org/apache/doris/catalog/ScalarType.java
index 7a3e50f..5805bd9 100644
--- a/fe/src/main/java/org/apache/doris/catalog/ScalarType.java
+++ b/fe/src/main/java/org/apache/doris/catalog/ScalarType.java
@@ -325,7 +325,7 @@ public class ScalarType extends Type {
                 stringBuilder.append("decimal").append("(").append(precision).append(", ").append(scale).append(")");
                 break;
             case BOOLEAN:
-                return "tinyint(1)";
+                return "boolean";
             case TINYINT:
                 return "tinyint(4)";
             case SMALLINT:


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org