Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-1786

Handle "true" keyword for numeric data types in cpimport

    XMLWordPrintable

Details

    • 2018-20

    Description

      I noticed that the cpimport utility currently does not handle "true" keyword. Inserting rows into a table with numeric columns assigned "true" values via the mariadb client works fine, but cpimport is converting these to 0 when imported via a text file.

      Here is an example:

      MariaDB [mcs]> create table t7 (a boolean, b tinyint, c smallint, d int, e bigint, f float, g double, h decimal(10, 3))engine=columnstore;
      Query OK, 0 rows affected (0.241 sec)
       
      MariaDB [mcs]> insert into t7 values (false, false, false, false, false, false, false, false), (true, true, true, true, true, true, true, true);
      Query OK, 2 rows affected (0.281 sec)
      Records: 2  Duplicates: 0  Warnings: 0
       
      MariaDB [mcs]> select * from t7;
      +------+------+------+------+------+------+------+-------+
      | a    | b    | c    | d    | e    | f    | g    | h     |
      +------+------+------+------+------+------+------+-------+
      |    0 |    0 |    0 |    0 |    0 |    0 |    0 | 0.000 |
      |    1 |    1 |    1 |    1 |    1 |    1 |    1 | 1.000 |
      +------+------+------+------+------+------+------+-------+
      2 rows in set (0.143 sec)
      

      Now inserting 2 records from a text file into this table using cpimport:

      tntnatbry:bin$ cat data.txt
      false|false|false|false|false|false|false|false
      true|true|true|true|true|true|true|true
       
      tntnatbry:bin$ sudo ./cpimport.bin mcs t7 ./data.txt
      

      The new contents of the table:

      MariaDB [mcs]> select * from t7;
      +------+------+------+------+------+------+------+-------+
      | a    | b    | c    | d    | e    | f    | g    | h     |
      +------+------+------+------+------+------+------+-------+
      |    0 |    0 |    0 |    0 |    0 |    0 |    0 | 0.000 |
      |    1 |    1 |    1 |    1 |    1 |    1 |    1 | 1.000 |
      |    0 |    0 |    0 |    0 |    0 |    0 |    0 | 0.000 |
      |    0 |    0 |    0 |    0 |    0 |    0 |    0 | 0.000 |
      +------+------+------+------+------+------+------+-------+
      4 rows in set (0.096 sec)
      

      I am assuming this is not intended behaviour.

      Attachments

        Issue Links

          Activity

            People

              winstone Zdravelina Sokolovska (Inactive)
              tntnatbry Gagan Goel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.