varchar(int) columns are reported as text in show create table
See original GitHub issueEdit:
varchar(int)
columns are reported as text
in show create table
, See https://github.com/crate/crate/issues/10230#issuecomment-659423800
Below is the original issue report:
CrateDB version: 4.1.8
Environment description: CrateDB on Mac
JAVA:
java version "14.0.1" 2020-04-14
Java(TM) SE Runtime Environment (build 14.0.1+7)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)
KERNEL:
19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
The number of nodes:
1
Configuration by default.
Problem description:
When I use CREATE TABLE users (id varchar, name varchar(6));
from the documentation: Varchar, I get this error:
SQLActionException[SQLParseException: line 1:45: extraneous input '(' expecting {',', ')'}]
It happens every time I use VARCHAR(INT)
.
Then, if I change VARCHAR(INT)
for TEXT
, I get this error:
SQLActionException[SQLParseException: Cannot find data type: varchar]
And when I change VARCHAR
for TEXT
, I mean, CREATE TABLE users (id TEXT, name TEXT);
then it works.
Steps to reproduce:
See Problem Description
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
That’s not good, at least the
SHOW CREATE TABLE
statement should show the varchar type. It shouldn’t loose information:From my understanding, the underlying data types are all the same, and
VARCHAR
andVARCHAR(int)
are only compatibility shims on top. But I’m not sure about that.