Hello community !
I just try a simple case, like :
create table foo (i int not null, j int default 100);
and obtain parser error: parse failed: Encountered "default" at line 1,
column 41.
while
create table foo (i int not null, j int);
insert into foo values (1, DEFAULT);
throws no exceptions in quidem test framework
i also find SqlValidatorTest#testInsertShouldNotCheckForDefaultValue that
contains newColumnDefaultValue:
// Now remove DEPTNO, which has a default value, from the target list.
// Will generate an extra call to newColumnDefaultValue at sql-to-rel
time,
// just not yet.
final String sql4 = "insert into ^emp^ (empno, ename, job, mgr,
hiredate,\n"
+ " sal, comm, slacker)\n"
+ "values(1, 'nom', 'job', 0,\n"
+ " timestamp '1970-01-01 00:00:00', 1, 1, false)";
org.apache.calcite.sql2rel.InitializerExpressionFactory#newColumnDefaultValue
so is it correct that:
1. calcite has no execution tests for CREATE TABLE with DEFAULT columns ?
2. seems can`t process correctly such kind of columns with insertions ? (i
see no tests)
CREATE TABLE integers(i INTEGER PRIMARY KEY, col1 INTEGER DEFAULT 200,
col2 INTEGER DEFAULT 100)
INSERT INTO integers VALUES (1, DEFAULT, DEFAULT)
INSERT INTO integers(i, col2) VALUES (2, DEFAULT), (3, 4), (4, DEFAULT)");
thanks !