From c304991e9fb83456757e10dba1c99b2809031ba1 Mon Sep 17 00:00:00 2001 From: pokeeffe-molecula <85502298+pokeeffe-molecula@users.noreply.github.com> Date: Mon, 5 Dec 2022 16:50:30 -0600 Subject: [PATCH] implemented extract ddl; tightened up type related stuff (#2329) * implemented extract ddl; tightened up type related stuff * added some test coverage * review feedback (cherry picked from commit f62313762c01d5dff90e33a87b3f45d258d7cbfb) --- dax/queryer/queryer.go | 2 +- http_handler.go | 39 +- sql3/parser/ast.go | 223 +-- sql3/parser/astdatatype.go | 145 +- sql3/parser/parser.go | 31 +- sql3/parser/parser_test.go | 22 +- sql3/planner/compilebulkinsert.go | 4 +- sql3/planner/compilecreatetable.go | 39 +- sql3/planner/compileinsert.go | 2 +- sql3/planner/compileshow.go | 219 ++- sql3/planner/executionplanner.go | 4 + sql3/planner/expression.go | 76 +- sql3/planner/expression_it_test.go | 2 +- sql3/planner/expressionagg.go | 14 +- sql3/planner/expressionanalyzer.go | 6 +- sql3/planner/expressionanalyzercall.go | 2 +- sql3/planner/expressionpql.go | 4 +- sql3/planner/expressiontypes.go | 31 +- sql3/planner/inbuiltfunctionsdate.go | 4 +- sql3/planner/opbulkinsert.go | 82 +- sql3/planner/opcreatetable.go | 2 +- sql3/planner/opdroptable.go | 2 +- sql3/planner/opfeaturebasecolumns.go | 38 +- sql3/planner/opfeaturebasetables.go | 36 +- sql3/planner/opfilter.go | 2 +- sql3/planner/opgroupby.go | 2 +- sql3/planner/opinsert.go | 2 +- sql3/planner/opnestedloops.go | 2 +- sql3/planner/opnulltable.go | 2 +- sql3/planner/oporderby.go | 4 +- sql3/planner/oppqlaggregate.go | 2 +- sql3/planner/oppqlgroupby.go | 2 +- sql3/planner/oppqlmultiaggregate.go | 2 +- sql3/planner/oppqlmultigroupby.go | 2 +- sql3/planner/oppqltablescan.go | 2 +- sql3/planner/opprojection.go | 2 +- sql3/planner/opquery.go | 2 +- sql3/planner/oprelalias.go | 2 +- sql3/planner/opsubquery.go | 2 +- sql3/planner/opsystemtable.go | 189 ++- sql3/planner/optablevaluedfunction.go | 2 +- sql3/planner/optop.go | 2 +- sql3/sql_complex_test.go | 33 +- sql3/test/defs/defs_between.go | 20 +- sql3/test/defs/defs_binops.go | 1798 ++++++++++++------------ sql3/test/defs/defs_cast.go | 86 +- sql3/test/defs/defs_date_functions.go | 4 +- sql3/test/defs/defs_inserts.go | 4 +- sql3/test/defs/defs_like.go | 32 +- sql3/test/defs/defs_null.go | 20 +- sql3/test/defs/defs_orderby.go | 4 +- sql3/test/defs/defs_set_functions.go | 14 +- sql3/test/defs/defs_timequantum.go | 2 +- sql3/test/defs/defs_unops.go | 32 +- sql3/test/helpers.go | 5 +- 55 files changed, 1832 insertions(+), 1476 deletions(-) diff --git a/dax/queryer/queryer.go b/dax/queryer/queryer.go index dbcbed6d0..4be9c5b79 100644 --- a/dax/queryer/queryer.go +++ b/dax/queryer/queryer.go @@ -162,7 +162,7 @@ func (q *Queryer) QuerySQL(ctx context.Context, qual dax.TableQualifier, sql str Fields: make([]*featurebase.WireQueryField, len(columns)), } for i, col := range columns { - btype, err := dax.BaseTypeFromString(col.Type.TypeName()) + btype, err := dax.BaseTypeFromString(col.Type.BaseTypeName()) if err != nil { applyError(errors.Wrap(err, "getting fieldtype from string")) return ret, nil diff --git a/http_handler.go b/http_handler.go index eb42f1a0a..e9b5cc96f 100644 --- a/http_handler.go +++ b/http_handler.go @@ -13,7 +13,6 @@ import ( "fmt" "io" "math" - "math/big" "mime" "net" "net/http" @@ -1438,30 +1437,36 @@ func (h *Handler) handlePostSQL(w http.ResponseWriter, r *http.Request) { // Write the closing bracket on any exit from this method. defer func() { + var execTime int64 = 0 + // we are going to make best effort here - don't actually care about the error + // if there was an error, the request.ElapsedTime will be zero + request, _ := h.api.server.SystemLayer.ExecutionRequests().GetRequest(requestID.String()) + execTime = request.ElapsedTime.Microseconds() + var value []byte - request, err := h.api.server.SystemLayer.ExecutionRequests().GetRequest(requestID.String()) + value, err = json.Marshal(execTime) if err != nil { - value = big.NewInt(-1).Bytes() + w.Write([]byte(`,"exec_time": 0`)) } else { - value, err = json.Marshal(request.ElapsedTime.Microseconds()) - if err != nil { - value = big.NewInt(-1).Bytes() - } + w.Write([]byte(`,"exec_time":`)) + w.Write(value) } - w.Write([]byte(`,"exec_time":`)) - w.Write(value) w.Write([]byte("}")) }() // writeError is a helper function that can be called anywhere during the // output handling to insert an error into the json output. - writeError := func(err error) { + writeError := func(err error, withComma bool) { if err != nil { errMsg, err := json.Marshal(err.Error()) if err != nil { errMsg = []byte(`"PROBLEM ENCODING ERROR MESSAGE"`) } - w.Write([]byte(`,"error":`)) + if withComma { + w.Write([]byte(`,"error":`)) + } else { + w.Write([]byte(`"error":`)) + } w.Write(errMsg) } } @@ -1499,7 +1504,7 @@ func (h *Handler) handlePostSQL(w http.ResponseWriter, r *http.Request) { // Get a query iterator. iter, err := rootOperator.Iterator(ctx, nil) if err != nil { - writeError(err) + writeError(err, false) writeWarnings(rootOperator.Warnings()) return } @@ -1510,15 +1515,15 @@ func (h *Handler) handlePostSQL(w http.ResponseWriter, r *http.Request) { Fields: make([]*WireQueryField, len(columns)), } for i, col := range columns { - btype, err := dax.BaseTypeFromString(col.Type.TypeName()) + btype, err := dax.BaseTypeFromString(col.Type.BaseTypeName()) if err != nil { - writeError(err) + writeError(err, false) writeWarnings(rootOperator.Warnings()) return } schema.Fields[i] = &WireQueryField{ Name: dax.FieldName(col.ColumnName), - Type: strings.ToLower(col.Type.TypeDescription()), // TODO(tlt): remove this once sql3 uses BaseTypes. + Type: col.Type.TypeDescription(), BaseType: btype, TypeInfo: col.Type.TypeInfo(), } @@ -1529,7 +1534,7 @@ func (h *Handler) handlePostSQL(w http.ResponseWriter, r *http.Request) { h.logger.Errorf("write schema response error: %s", err) // Provide an empty list as the schema value to maintain valid json. w.Write([]byte("[]")) - writeError(err) + writeError(err, false) writeWarnings(rootOperator.Warnings()) return } @@ -1565,7 +1570,7 @@ func (h *Handler) handlePostSQL(w http.ResponseWriter, r *http.Request) { w.Write([]byte("]")) - writeError(rowErr) + writeError(rowErr, true) writeWarnings(rootOperator.Warnings()) writePlan(rootOperator.Plan()) } diff --git a/sql3/parser/ast.go b/sql3/parser/ast.go index 30431aee2..0415b4c3e 100644 --- a/sql3/parser/ast.go +++ b/sql3/parser/ast.go @@ -13,114 +13,116 @@ type Node interface { fmt.Stringer } -func (*AlterTableStatement) node() {} -func (*AnalyzeStatement) node() {} -func (*Assignment) node() {} -func (*ShowTablesStatement) node() {} -func (*ShowColumnsStatement) node() {} -func (*BeginStatement) node() {} -func (*BinaryExpr) node() {} -func (*BoolLit) node() {} -func (*BulkInsertMapDefinition) node() {} -func (*BulkInsertStatement) node() {} -func (*CacheTypeConstraint) node() {} -func (*Call) node() {} -func (*CaseBlock) node() {} -func (*CaseExpr) node() {} -func (*CastExpr) node() {} -func (*CheckConstraint) node() {} -func (*ColumnDefinition) node() {} -func (*CommitStatement) node() {} -func (*CreateIndexStatement) node() {} -func (*CreateTableStatement) node() {} -func (*CreateFunctionStatement) node() {} -func (*CreateViewStatement) node() {} -func (*DateLit) node() {} -func (*DefaultConstraint) node() {} -func (*DeleteStatement) node() {} -func (*DropIndexStatement) node() {} -func (*DropTableStatement) node() {} -func (*DropFunctionStatement) node() {} -func (*DropViewStatement) node() {} -func (*Exists) node() {} -func (*ExplainStatement) node() {} -func (*ExprList) node() {} -func (*FilterClause) node() {} -func (*FloatLit) node() {} -func (*ForeignKeyArg) node() {} -func (*ForeignKeyConstraint) node() {} -func (*FrameSpec) node() {} -func (*Ident) node() {} -func (*Variable) node() {} -func (*IndexedColumn) node() {} -func (*InsertStatement) node() {} -func (*JoinClause) node() {} -func (*JoinOperator) node() {} -func (*KeyPartitionsOption) node() {} -func (*MinConstraint) node() {} -func (*MaxConstraint) node() {} -func (*NotNullConstraint) node() {} -func (*NullLit) node() {} -func (*IntegerLit) node() {} -func (*OnConstraint) node() {} -func (*OrderingTerm) node() {} -func (*OverClause) node() {} -func (*ParenExpr) node() {} -func (*SetLiteralExpr) node() {} -func (*ParenSource) node() {} -func (*PrimaryKeyConstraint) node() {} -func (*QualifiedRef) node() {} -func (*QualifiedTableName) node() {} -func (*Range) node() {} -func (*ReleaseStatement) node() {} -func (*ResultColumn) node() {} -func (*RollbackStatement) node() {} -func (*SavepointStatement) node() {} -func (*SelectStatement) node() {} -func (*ShardWidthOption) node() {} -func (*StringLit) node() {} -func (*TableValuedFunction) node() {} -func (*TimeUnitConstraint) node() {} -func (*TimeQuantumConstraint) node() {} -func (*TupleLiteralExpr) node() {} -func (*Type) node() {} -func (*UnaryExpr) node() {} -func (*UniqueConstraint) node() {} -func (*UpdateStatement) node() {} -func (*UpsertClause) node() {} -func (*UsingConstraint) node() {} -func (*Window) node() {} -func (*WindowDefinition) node() {} -func (*WithClause) node() {} +func (*AlterTableStatement) node() {} +func (*AnalyzeStatement) node() {} +func (*Assignment) node() {} +func (*ShowTablesStatement) node() {} +func (*ShowColumnsStatement) node() {} +func (*ShowCreateTableStatement) node() {} +func (*BeginStatement) node() {} +func (*BinaryExpr) node() {} +func (*BoolLit) node() {} +func (*BulkInsertMapDefinition) node() {} +func (*BulkInsertStatement) node() {} +func (*CacheTypeConstraint) node() {} +func (*Call) node() {} +func (*CaseBlock) node() {} +func (*CaseExpr) node() {} +func (*CastExpr) node() {} +func (*CheckConstraint) node() {} +func (*ColumnDefinition) node() {} +func (*CommitStatement) node() {} +func (*CreateIndexStatement) node() {} +func (*CreateTableStatement) node() {} +func (*CreateFunctionStatement) node() {} +func (*CreateViewStatement) node() {} +func (*DateLit) node() {} +func (*DefaultConstraint) node() {} +func (*DeleteStatement) node() {} +func (*DropIndexStatement) node() {} +func (*DropTableStatement) node() {} +func (*DropFunctionStatement) node() {} +func (*DropViewStatement) node() {} +func (*Exists) node() {} +func (*ExplainStatement) node() {} +func (*ExprList) node() {} +func (*FilterClause) node() {} +func (*FloatLit) node() {} +func (*ForeignKeyArg) node() {} +func (*ForeignKeyConstraint) node() {} +func (*FrameSpec) node() {} +func (*Ident) node() {} +func (*Variable) node() {} +func (*IndexedColumn) node() {} +func (*InsertStatement) node() {} +func (*JoinClause) node() {} +func (*JoinOperator) node() {} +func (*KeyPartitionsOption) node() {} +func (*MinConstraint) node() {} +func (*MaxConstraint) node() {} +func (*NotNullConstraint) node() {} +func (*NullLit) node() {} +func (*IntegerLit) node() {} +func (*OnConstraint) node() {} +func (*OrderingTerm) node() {} +func (*OverClause) node() {} +func (*ParenExpr) node() {} +func (*SetLiteralExpr) node() {} +func (*ParenSource) node() {} +func (*PrimaryKeyConstraint) node() {} +func (*QualifiedRef) node() {} +func (*QualifiedTableName) node() {} +func (*Range) node() {} +func (*ReleaseStatement) node() {} +func (*ResultColumn) node() {} +func (*RollbackStatement) node() {} +func (*SavepointStatement) node() {} +func (*SelectStatement) node() {} +func (*ShardWidthOption) node() {} +func (*StringLit) node() {} +func (*TableValuedFunction) node() {} +func (*TimeUnitConstraint) node() {} +func (*TimeQuantumConstraint) node() {} +func (*TupleLiteralExpr) node() {} +func (*Type) node() {} +func (*UnaryExpr) node() {} +func (*UniqueConstraint) node() {} +func (*UpdateStatement) node() {} +func (*UpsertClause) node() {} +func (*UsingConstraint) node() {} +func (*Window) node() {} +func (*WindowDefinition) node() {} +func (*WithClause) node() {} type Statement interface { Node stmt() } -func (*AlterTableStatement) stmt() {} -func (*AnalyzeStatement) stmt() {} -func (*BeginStatement) stmt() {} -func (*BulkInsertStatement) stmt() {} -func (*ShowTablesStatement) stmt() {} -func (*ShowColumnsStatement) stmt() {} -func (*CommitStatement) stmt() {} -func (*CreateIndexStatement) stmt() {} -func (*CreateTableStatement) stmt() {} -func (*CreateFunctionStatement) stmt() {} -func (*CreateViewStatement) stmt() {} -func (*DeleteStatement) stmt() {} -func (*DropIndexStatement) stmt() {} -func (*DropTableStatement) stmt() {} -func (*DropFunctionStatement) stmt() {} -func (*DropViewStatement) stmt() {} -func (*ExplainStatement) stmt() {} -func (*InsertStatement) stmt() {} -func (*ReleaseStatement) stmt() {} -func (*RollbackStatement) stmt() {} -func (*SavepointStatement) stmt() {} -func (*SelectStatement) stmt() {} -func (*UpdateStatement) stmt() {} +func (*AlterTableStatement) stmt() {} +func (*AnalyzeStatement) stmt() {} +func (*BeginStatement) stmt() {} +func (*BulkInsertStatement) stmt() {} +func (*ShowTablesStatement) stmt() {} +func (*ShowColumnsStatement) stmt() {} +func (*ShowCreateTableStatement) stmt() {} +func (*CommitStatement) stmt() {} +func (*CreateIndexStatement) stmt() {} +func (*CreateTableStatement) stmt() {} +func (*CreateFunctionStatement) stmt() {} +func (*CreateViewStatement) stmt() {} +func (*DeleteStatement) stmt() {} +func (*DropIndexStatement) stmt() {} +func (*DropTableStatement) stmt() {} +func (*DropFunctionStatement) stmt() {} +func (*DropViewStatement) stmt() {} +func (*ExplainStatement) stmt() {} +func (*InsertStatement) stmt() {} +func (*ReleaseStatement) stmt() {} +func (*RollbackStatement) stmt() {} +func (*SavepointStatement) stmt() {} +func (*SelectStatement) stmt() {} +func (*UpdateStatement) stmt() {} // CloneStatement returns a deep copy stmt. func CloneStatement(stmt Statement) Statement { @@ -494,6 +496,23 @@ func (s *ShowColumnsStatement) String() string { return buf.String() } +type ShowCreateTableStatement struct { + Show Pos // position of SHOW + Create Pos // position of CREATE + Table Pos // position of CREATE + TableName *Ident // name of table +} + +// String returns the string representation of the statement. +func (s *ShowCreateTableStatement) String() string { + var buf bytes.Buffer + buf.WriteString("SHOW CREATE TABLE ") + if s.TableName != nil { + fmt.Fprintf(&buf, " %s", s.TableName.String()) + } + return buf.String() +} + type BeginStatement struct { Begin Pos // position of BEGIN Deferred Pos // position of DEFERRED keyword diff --git a/sql3/parser/astdatatype.go b/sql3/parser/astdatatype.go index 30bba88f7..1eca2ee96 100644 --- a/sql3/parser/astdatatype.go +++ b/sql3/parser/astdatatype.go @@ -3,43 +3,39 @@ package parser import ( "fmt" "strings" -) -// TODO(pok) make all these lower case -const ( - FieldTypeBool = "BOOL" - FieldTypeDecimal = "DECIMAL" - FieldTypeID = "ID" - FieldTypeIDSet = "IDSET" - FieldTypeIDSetQuantum = "IDSETQ" - FieldTypeInt = "INT" - FieldTypeString = "STRING" - FieldTypeStringSet = "STRINGSET" - FieldTypeStringSetQuantum = "STRINGSETQ" - FieldTypeTimestamp = "TIMESTAMP" + "github.com/molecula/featurebase/v3/dax" ) func IsValidTypeName(typeName string) bool { - switch strings.ToUpper(typeName) { - case FieldTypeBool, - FieldTypeDecimal, - FieldTypeID, - FieldTypeIDSet, - FieldTypeInt, - FieldTypeString, - FieldTypeStringSet, - FieldTypeTimestamp: + switch strings.ToLower(typeName) { + case dax.BaseTypeBool, + dax.BaseTypeDecimal, + dax.BaseTypeID, + dax.BaseTypeIDSet, + dax.BaseTypeInt, + dax.BaseTypeString, + dax.BaseTypeStringSet, + dax.BaseTypeTimestamp: return true default: return false } } +// ExprDataType is the interface for all language layer types type ExprDataType interface { exprDataType() - TypeName() string - TypeDescription() string + // the base type name e.g. int or decimal + BaseTypeName() string + // additional type information - intended to be used outside the language + // layer (marshalled over json, or otherwise serialized so that consumers + // have access to complete type information) + // TypeInfo is not used inside the language layer itself, as the concrete + // types (e.g. DataTypeString) are used TypeInfo() map[string]interface{} + // the full type specification as a string - intended to be human readable + TypeDescription() string } func (*DataTypeVoid) exprDataType() {} @@ -64,12 +60,12 @@ func NewDataTypeVoid() *DataTypeVoid { return &DataTypeVoid{} } -func (*DataTypeVoid) TypeName() string { - return "VOID" +func (*DataTypeVoid) BaseTypeName() string { + return "void" } func (dt *DataTypeVoid) TypeDescription() string { - return dt.TypeName() + return dt.BaseTypeName() } func (*DataTypeVoid) TypeInfo() map[string]interface{} { @@ -86,12 +82,12 @@ func NewDataTypeRange(subscriptType ExprDataType) *DataTypeRange { } } -func (dt *DataTypeRange) TypeName() string { - return fmt.Sprintf("RANGE(%s)", dt.SubscriptType.TypeName()) +func (dt *DataTypeRange) BaseTypeName() string { + return "range" } func (dt *DataTypeRange) TypeDescription() string { - return dt.TypeName() + return fmt.Sprintf("range(%s)", dt.SubscriptType.TypeDescription()) } func (*DataTypeRange) TypeInfo() map[string]interface{} { @@ -108,19 +104,19 @@ func NewDataTypeTuple(members []ExprDataType) *DataTypeTuple { } } -func (dt *DataTypeTuple) TypeName() string { +func (dt *DataTypeTuple) BaseTypeName() string { + return "tuple" +} + +func (dt *DataTypeTuple) TypeDescription() string { ms := "" for idx, m := range dt.Members { - ms = ms + m.TypeName() + ms = ms + m.TypeDescription() if idx+1 < len(dt.Members) { ms = ms + ", " } } - return fmt.Sprintf("TUPLE(%s)", ms) -} - -func (dt *DataTypeTuple) TypeDescription() string { - return dt.TypeName() + return fmt.Sprintf("tuple(%s)", ms) } func (*DataTypeTuple) TypeInfo() map[string]interface{} { @@ -142,19 +138,19 @@ func NewDataTypeSubtable(columns []*SubtableColumn) *DataTypeSubtable { } } -func (dt *DataTypeSubtable) TypeName() string { +func (dt *DataTypeSubtable) BaseTypeName() string { + return "subtable" +} + +func (dt *DataTypeSubtable) TypeDescription() string { ms := "" for idx, m := range dt.Columns { - ms = ms + m.DataType.TypeName() + ms = ms + m.DataType.TypeDescription() if idx+1 < len(dt.Columns) { ms = ms + ", " } } - return fmt.Sprintf("SUBTABLE(%s)", ms) -} - -func (dt *DataTypeSubtable) TypeDescription() string { - return dt.TypeName() + return fmt.Sprintf("subtable(%s)", ms) } func (*DataTypeSubtable) TypeInfo() map[string]interface{} { @@ -168,12 +164,12 @@ func NewDataTypeBool() *DataTypeBool { return &DataTypeBool{} } -func (*DataTypeBool) TypeName() string { - return FieldTypeBool +func (*DataTypeBool) BaseTypeName() string { + return dax.BaseTypeBool } func (dt *DataTypeBool) TypeDescription() string { - return dt.TypeName() + return dt.BaseTypeName() } func (*DataTypeBool) TypeInfo() map[string]interface{} { @@ -190,12 +186,12 @@ func NewDataTypeDecimal(scale int64) *DataTypeDecimal { } } -func (d *DataTypeDecimal) TypeName() string { - return FieldTypeDecimal +func (d *DataTypeDecimal) BaseTypeName() string { + return dax.BaseTypeDecimal } func (d *DataTypeDecimal) TypeDescription() string { - return fmt.Sprintf("%s(%d)", FieldTypeDecimal, d.Scale) + return fmt.Sprintf("%s(%d)", dax.BaseTypeDecimal, d.Scale) } func (d *DataTypeDecimal) TypeInfo() map[string]interface{} { @@ -211,12 +207,12 @@ func NewDataTypeID() *DataTypeID { return &DataTypeID{} } -func (*DataTypeID) TypeName() string { - return FieldTypeID +func (*DataTypeID) BaseTypeName() string { + return dax.BaseTypeID } func (dt *DataTypeID) TypeDescription() string { - return dt.TypeName() + return dt.BaseTypeName() } func (*DataTypeID) TypeInfo() map[string]interface{} { @@ -230,18 +226,19 @@ func NewDataTypeIDSet() *DataTypeIDSet { return &DataTypeIDSet{} } -func (*DataTypeIDSet) TypeName() string { - return FieldTypeIDSet +func (*DataTypeIDSet) BaseTypeName() string { + return dax.BaseTypeIDSet } func (dt *DataTypeIDSet) TypeDescription() string { - return dt.TypeName() + return dt.BaseTypeName() } func (*DataTypeIDSet) TypeInfo() map[string]interface{} { return nil } +// TODO (pok) should time quantum be it's own type and not a constraint? type DataTypeIDSetQuantum struct { } @@ -249,12 +246,12 @@ func NewDataTypeIDSetQuantum() *DataTypeIDSetQuantum { return &DataTypeIDSetQuantum{} } -func (*DataTypeIDSetQuantum) TypeName() string { - return FieldTypeIDSetQuantum +func (*DataTypeIDSetQuantum) BaseTypeName() string { + return dax.BaseTypeIDSet } func (dt *DataTypeIDSetQuantum) TypeDescription() string { - return dt.TypeName() + return dt.BaseTypeName() } func (*DataTypeIDSetQuantum) TypeInfo() map[string]interface{} { @@ -268,12 +265,12 @@ func NewDataTypeInt() *DataTypeInt { return &DataTypeInt{} } -func (*DataTypeInt) TypeName() string { - return FieldTypeInt +func (*DataTypeInt) BaseTypeName() string { + return dax.BaseTypeInt } func (dt *DataTypeInt) TypeDescription() string { - return dt.TypeName() + return dt.BaseTypeName() } func (*DataTypeInt) TypeInfo() map[string]interface{} { @@ -287,12 +284,12 @@ func NewDataTypeString() *DataTypeString { return &DataTypeString{} } -func (*DataTypeString) TypeName() string { - return FieldTypeString +func (*DataTypeString) BaseTypeName() string { + return dax.BaseTypeString } func (dt *DataTypeString) TypeDescription() string { - return dt.TypeName() + return dt.BaseTypeName() } func (*DataTypeString) TypeInfo() map[string]interface{} { @@ -306,12 +303,12 @@ func NewDataTypeStringSet() *DataTypeStringSet { return &DataTypeStringSet{} } -func (*DataTypeStringSet) TypeName() string { - return FieldTypeStringSet +func (*DataTypeStringSet) BaseTypeName() string { + return dax.BaseTypeStringSet } func (dt *DataTypeStringSet) TypeDescription() string { - return dt.TypeName() + return dt.BaseTypeName() } func (*DataTypeStringSet) TypeInfo() map[string]interface{} { @@ -325,12 +322,12 @@ func NewDataTypeStringSetQuantum() *DataTypeStringSetQuantum { return &DataTypeStringSetQuantum{} } -func (*DataTypeStringSetQuantum) TypeName() string { - return FieldTypeStringSetQuantum +func (*DataTypeStringSetQuantum) BaseTypeName() string { + return dax.BaseTypeStringSet } func (dt *DataTypeStringSetQuantum) TypeDescription() string { - return dt.TypeName() + return dt.BaseTypeName() } func (*DataTypeStringSetQuantum) TypeInfo() map[string]interface{} { @@ -344,12 +341,12 @@ func NewDataTypeTimestamp() *DataTypeTimestamp { return &DataTypeTimestamp{} } -func (*DataTypeTimestamp) TypeName() string { - return FieldTypeTimestamp +func (*DataTypeTimestamp) BaseTypeName() string { + return dax.BaseTypeTimestamp } func (dt *DataTypeTimestamp) TypeDescription() string { - return dt.TypeName() + return dt.BaseTypeName() } func (*DataTypeTimestamp) TypeInfo() map[string]interface{} { diff --git a/sql3/parser/parser.go b/sql3/parser/parser.go index fe4bb287c..7320a3b5e 100644 --- a/sql3/parser/parser.go +++ b/sql3/parser/parser.go @@ -163,8 +163,10 @@ func (p *Parser) parseShowStatement() (Statement, error) { return p.parseShowTablesStatement(show) case COLUMNS: return p.parseShowColumnsStatement(show) + case CREATE: + return p.parseShowCreateStatement(show) default: - return nil, p.errorExpected(p.pos, p.tok, "TABLES, COLUMNS") + return nil, p.errorExpected(p.pos, p.tok, "TABLES, COLUMNS or CREATE") } } @@ -200,6 +202,33 @@ func (p *Parser) parseShowColumnsStatement(showPos Pos) (_ *ShowColumnsStatement } } +func (p *Parser) parseShowCreateStatement(showPos Pos) (Statement, error) { + assert(p.peek() == CREATE) + create, _, _ := p.scan() + + switch p.peek() { + case TABLE: + return p.parseShowCreateTableStatement(showPos, create) + default: + return nil, p.errorExpected(p.pos, p.tok, "TABLES") + } +} + +func (p *Parser) parseShowCreateTableStatement(showPos Pos, createPos Pos) (_ *ShowCreateTableStatement, err error) { + assert(p.peek() == TABLE) + table, _, _ := p.scan() + + var stmt ShowCreateTableStatement + stmt.Show = showPos + stmt.Create = createPos + stmt.Table = table + + if stmt.TableName, err = p.parseIdent("table name"); err != nil { + return &stmt, err + } + return &stmt, nil +} + /*func (p *Parser) parseBeginStatement() (*BeginStatement, error) { assert(p.peek() == BEGIN) diff --git a/sql3/parser/parser_test.go b/sql3/parser/parser_test.go index cb2388cef..0c4145ff4 100644 --- a/sql3/parser/parser_test.go +++ b/sql3/parser/parser_test.go @@ -627,8 +627,8 @@ func TestParser_ParseStatement(t *testing.T) { Show: pos(0), Tables: pos(5), }) - AssertParseStatementError(t, `SHOW`, `1:4: expected TABLES, COLUMNS, found 'EOF'`) - AssertParseStatementError(t, `SHOW BLAH`, `1:6: expected TABLES, COLUMNS, found BLAH`) + AssertParseStatementError(t, `SHOW`, `1:4: expected TABLES, COLUMNS or CREATE, found 'EOF'`) + AssertParseStatementError(t, `SHOW BLAH`, `1:6: expected TABLES, COLUMNS or CREATE, found BLAH`) }) t.Run("ShowColumns", func(t *testing.T) { @@ -641,13 +641,29 @@ func TestParser_ParseStatement(t *testing.T) { NamePos: pos(18), }, }) - AssertParseStatementError(t, `SHOW`, `1:4: expected TABLES, COLUMNS, found 'EOF'`) + AssertParseStatementError(t, `SHOW`, `1:4: expected TABLES, COLUMNS or CREATE, found 'EOF'`) AssertParseStatementError(t, `SHOW COLUMNS`, `1:12: expected FROM, found 'EOF'`) AssertParseStatementError(t, `SHOW COLUMNS FOO`, `1:14: expected FROM, found FOO`) AssertParseStatementError(t, `SHOW COLUMNS FROM`, `1:17: expected table name, found 'EOF'`) AssertParseStatementError(t, `SHOW COLUMNS FROM 12`, `1:19: expected table name, found 12`) }) + t.Run("ShowCreateTable", func(t *testing.T) { + AssertParseStatement(t, `SHOW CREATE TABLE FOO`, &parser.ShowCreateTableStatement{ + Show: pos(0), + Create: pos(5), + Table: pos(12), + TableName: &parser.Ident{ + Name: "FOO", + NamePos: pos(18), + }, + }) + AssertParseStatementError(t, `SHOW`, `1:4: expected TABLES, COLUMNS or CREATE, found 'EOF'`) + AssertParseStatementError(t, `SHOW CREATE`, `1:11: expected TABLES, found 'EOF'`) + AssertParseStatementError(t, `SHOW CREATE TABLE`, `1:17: expected table name, found 'EOF'`) + AssertParseStatementError(t, `SHOW CREATE TABLE 12`, `1:19: expected table name, found 12`) + }) + t.Run("Explain", func(t *testing.T) { /*t.Run("", func(t *testing.T) { AssertParseStatement(t, `EXPLAIN BEGIN`, &parser.ExplainStatement{ diff --git a/sql3/planner/compilebulkinsert.go b/sql3/planner/compilebulkinsert.go index 360848a51..1b863052a 100644 --- a/sql3/planner/compilebulkinsert.go +++ b/sql3/planner/compilebulkinsert.go @@ -337,7 +337,7 @@ func (p *ExecutionPlanner) analyzeBulkInsertStatement(stmt *parser.BulkInsertSta if stmt.TransformList != nil { t := stmt.TransformList[idx] if !typesAreAssignmentCompatible(colDataType, t.DataType()) { - return sql3.NewErrTypeAssignmentIncompatible(t.Pos().Line, t.Pos().Column, t.DataType().TypeName(), colDataType.TypeName()) + return sql3.NewErrTypeAssignmentIncompatible(t.Pos().Line, t.Pos().Column, t.DataType().TypeDescription(), colDataType.TypeDescription()) } } else { // this assumes that map and col list have already been checked for length @@ -347,7 +347,7 @@ func (p *ExecutionPlanner) analyzeBulkInsertStatement(stmt *parser.BulkInsertSta return err } if !typesAreAssignmentCompatible(colDataType, t) { - return sql3.NewErrTypeAssignmentIncompatible(me.MapExpr.Pos().Line, me.MapExpr.Pos().Column, t.TypeName(), colDataType.TypeName()) + return sql3.NewErrTypeAssignmentIncompatible(me.MapExpr.Pos().Line, me.MapExpr.Pos().Column, t.TypeDescription(), colDataType.TypeDescription()) } } break diff --git a/sql3/planner/compilecreatetable.go b/sql3/planner/compilecreatetable.go index 1581ac8d3..842526b37 100644 --- a/sql3/planner/compilecreatetable.go +++ b/sql3/planner/compilecreatetable.go @@ -7,11 +7,12 @@ import ( "strings" "time" - pilosa "github.com/featurebasedb/featurebase/v3" - "github.com/featurebasedb/featurebase/v3/pql" - "github.com/featurebasedb/featurebase/v3/sql3" - "github.com/featurebasedb/featurebase/v3/sql3/parser" - "github.com/featurebasedb/featurebase/v3/sql3/planner/types" + pilosa "github.com/molecula/featurebase/v3" + "github.com/molecula/featurebase/v3/dax" + "github.com/molecula/featurebase/v3/pql" + "github.com/molecula/featurebase/v3/sql3" + "github.com/molecula/featurebase/v3/sql3/parser" + "github.com/molecula/featurebase/v3/sql3/planner/types" ) type createTableField struct { @@ -49,7 +50,7 @@ func (p *ExecutionPlanner) compileCreateTableStatement(stmt *parser.CreateTableS typeName := parser.IdentName(col.Type.Name) if strings.ToLower(columnName) == "_id" { - if strings.EqualFold(typeName, parser.FieldTypeString) { + if strings.EqualFold(typeName, dax.BaseTypeString) { isKeyed = true } continue @@ -181,10 +182,10 @@ func (p *ExecutionPlanner) compileColumn(col *parser.ColumnDefinition) (*createT } } - switch strings.ToUpper(typeName) { - case parser.FieldTypeBool: + switch strings.ToLower(typeName) { + case dax.BaseTypeBool: column.fos = append(column.fos, pilosa.OptFieldTypeBool()) - case parser.FieldTypeDecimal: + case dax.BaseTypeDecimal: // Get the scale value. scale, err = strconv.ParseInt(col.Type.Scale.Value, 10, 64) if err != nil { @@ -201,27 +202,27 @@ func (p *ExecutionPlanner) compileColumn(col *parser.ColumnDefinition) (*createT } column.fos = append(column.fos, pilosa.OptFieldTypeDecimal(scale, min, max)) - case parser.FieldTypeID: + case dax.BaseTypeID: column.fos = append(column.fos, pilosa.OptFieldTypeMutex(cacheType, cacheSize)) - case parser.FieldTypeIDSet: + case dax.BaseTypeIDSet: if timeQuantum != "" { column.fos = append(column.fos, pilosa.OptFieldTypeTime(timeQuantum, ttl)) } else { column.fos = append(column.fos, pilosa.OptFieldTypeSet(cacheType, cacheSize)) } - case parser.FieldTypeInt: + case dax.BaseTypeInt: column.fos = append(column.fos, pilosa.OptFieldTypeInt(min.ToInt64(0), max.ToInt64(0))) - case parser.FieldTypeString: + case dax.BaseTypeString: column.fos = append(column.fos, pilosa.OptFieldTypeMutex(cacheType, cacheSize)) column.fos = append(column.fos, pilosa.OptFieldKeys()) - case parser.FieldTypeStringSet: + case dax.BaseTypeStringSet: if timeQuantum != "" { column.fos = append(column.fos, pilosa.OptFieldTypeTime(timeQuantum, ttl)) } else { column.fos = append(column.fos, pilosa.OptFieldTypeSet(cacheType, cacheSize)) } column.fos = append(column.fos, pilosa.OptFieldKeys()) - case parser.FieldTypeTimestamp: + case dax.BaseTypeTimestamp: column.fos = append(column.fos, pilosa.OptFieldTypeTimestamp(epoch, timeUnit)) } return column, nil @@ -246,7 +247,7 @@ func (p *ExecutionPlanner) analyzeCreateTableStatement(stmt *parser.CreateTableS if strings.ToLower(columnName) == "_id" { //check the type - if !(strings.EqualFold(typeName, parser.FieldTypeID) || strings.EqualFold(typeName, parser.FieldTypeString)) { + if !(strings.EqualFold(typeName, dax.BaseTypeID) || strings.EqualFold(typeName, dax.BaseTypeString)) { return sql3.NewErrTableIDColumnType(col.Type.Name.NamePos.Line, col.Type.Name.NamePos.Column) } //make sure we have no constraints @@ -324,7 +325,7 @@ func (p *ExecutionPlanner) analyzeColumn(typeName string, col *parser.ColumnDefi switch c := con.(type) { case *parser.CacheTypeConstraint: //make sure we have a set or mutex type - if !(strings.EqualFold(typeName, parser.FieldTypeString) || strings.EqualFold(typeName, parser.FieldTypeStringSet) || strings.EqualFold(typeName, parser.FieldTypeID) || strings.EqualFold(typeName, parser.FieldTypeIDSet)) { + if !(strings.EqualFold(typeName, dax.BaseTypeString) || strings.EqualFold(typeName, dax.BaseTypeStringSet) || strings.EqualFold(typeName, dax.BaseTypeID) || strings.EqualFold(typeName, dax.BaseTypeIDSet)) { return sql3.NewErrBadColumnConstraint(col.Name.NamePos.Line, col.Name.NamePos.Column, "CACHETYPE", typeName) } //check the type of the expression for SIZE @@ -362,7 +363,7 @@ func (p *ExecutionPlanner) analyzeColumn(typeName string, col *parser.ColumnDefi case *parser.TimeUnitConstraint: //make sure we have an timestamp type - if !strings.EqualFold(typeName, parser.FieldTypeTimestamp) { + if !strings.EqualFold(typeName, dax.BaseTypeTimestamp) { return sql3.NewErrBadColumnConstraint(col.Name.NamePos.Line, col.Name.NamePos.Column, "TIMEUNIT", typeName) } //check the type of the expression @@ -384,7 +385,7 @@ func (p *ExecutionPlanner) analyzeColumn(typeName string, col *parser.ColumnDefi case *parser.TimeQuantumConstraint: //make sure we have a set type - if !(strings.EqualFold(typeName, parser.FieldTypeStringSet) || strings.EqualFold(typeName, parser.FieldTypeIDSet)) { + if !(strings.EqualFold(typeName, dax.BaseTypeStringSet) || strings.EqualFold(typeName, dax.BaseTypeIDSet)) { return sql3.NewErrBadColumnConstraint(col.Name.NamePos.Line, col.Name.NamePos.Column, "TIMEQUANTUM", typeName) } //check the type of the expression diff --git a/sql3/planner/compileinsert.go b/sql3/planner/compileinsert.go index b2e9e96c2..fddd5fcb7 100644 --- a/sql3/planner/compileinsert.go +++ b/sql3/planner/compileinsert.go @@ -176,7 +176,7 @@ func (p *ExecutionPlanner) analyzeInsertStatement(stmt *parser.InsertStatement) // Type check against same ordinal position in column type list. if !typesAreAssignmentCompatible(typeNames[i], e.DataType()) { - return sql3.NewErrTypeAssignmentIncompatible(expr.Pos().Line, expr.Pos().Column, e.DataType().TypeName(), typeNames[i].TypeName()) + return sql3.NewErrTypeAssignmentIncompatible(expr.Pos().Line, expr.Pos().Column, e.DataType().TypeDescription(), typeNames[i].TypeDescription()) } tuple.Exprs[i] = e diff --git a/sql3/planner/compileshow.go b/sql3/planner/compileshow.go index 3d671ca01..3112c89e5 100644 --- a/sql3/planner/compileshow.go +++ b/sql3/planner/compileshow.go @@ -4,6 +4,7 @@ package planner import ( "context" + "strings" pilosa "github.com/featurebasedb/featurebase/v3" "github.com/featurebasedb/featurebase/v3/sql3" @@ -18,32 +19,61 @@ func (p *ExecutionPlanner) compileShowTablesStatement(stmt parser.Statement) (ty return nil, errors.Wrap(err, "getting schema") } - columns := []types.PlanExpression{&qualifiedRefPlanExpression{ - tableName: "fb$tables", - columnName: "name", - columnIndex: 0, - dataType: parser.NewDataTypeString(), - }, &qualifiedRefPlanExpression{ - tableName: "fb$tables", - columnName: "created_at", - columnIndex: 1, - dataType: parser.NewDataTypeTimestamp(), - }, &qualifiedRefPlanExpression{ - tableName: "fb$tables", - columnName: "track_existence", - columnIndex: 2, - dataType: parser.NewDataTypeBool(), - }, &qualifiedRefPlanExpression{ - tableName: "fb$tables", - columnName: "keys", - columnIndex: 3, - dataType: parser.NewDataTypeBool(), - }, &qualifiedRefPlanExpression{ - tableName: "fb$tables", - columnName: "shard_width", - columnIndex: 4, - dataType: parser.NewDataTypeInt(), - }} + columns := []types.PlanExpression{ + &qualifiedRefPlanExpression{ + tableName: "fb_tables", + columnName: "_id", + columnIndex: 0, + dataType: parser.NewDataTypeString(), + }, + &qualifiedRefPlanExpression{ + tableName: "fb_tables", + columnName: "name", + columnIndex: 1, + dataType: parser.NewDataTypeString(), + }, + &qualifiedRefPlanExpression{ + tableName: "fb_tables", + columnName: "owner", + columnIndex: 2, + dataType: parser.NewDataTypeString(), + }, + &qualifiedRefPlanExpression{ + tableName: "fb_tables", + columnName: "last_updated_user", + columnIndex: 3, + dataType: parser.NewDataTypeString(), + }, + &qualifiedRefPlanExpression{ + tableName: "fb_tables", + columnName: "created_at", + columnIndex: 4, + dataType: parser.NewDataTypeTimestamp(), + }, + &qualifiedRefPlanExpression{ + tableName: "fb_tables", + columnName: "track_existence", + columnIndex: 5, + dataType: parser.NewDataTypeBool(), + }, + &qualifiedRefPlanExpression{ + tableName: "fb_tables", + columnName: "keys", + columnIndex: 6, + dataType: parser.NewDataTypeBool(), + }, + &qualifiedRefPlanExpression{ + tableName: "fb_tables", + columnName: "shard_width", + columnIndex: 7, + dataType: parser.NewDataTypeInt(), + }, + &qualifiedRefPlanExpression{ + tableName: "fb_tables", + columnName: "description", + columnIndex: 8, + dataType: parser.NewDataTypeString(), + }} return NewPlanOpQuery(p, NewPlanOpProjection(columns, NewPlanOpFeatureBaseTables(indexInfo)), p.sql), nil } @@ -59,76 +89,127 @@ func (p *ExecutionPlanner) compileShowColumnsStatement(stmt *parser.ShowColumnsS } columns := []types.PlanExpression{&qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "name", + tableName: "fb_table_columns", + columnName: "_id", columnIndex: 0, dataType: parser.NewDataTypeString(), - }, &qualifiedRefPlanExpression{ // the SQL3 data type description - tableName: "fb$table_columns", - columnName: "type", + }, &qualifiedRefPlanExpression{ + tableName: "fb_table_columns", + columnName: "name", columnIndex: 1, dataType: parser.NewDataTypeString(), - }, &qualifiedRefPlanExpression{ // the FeatureBase 'native' data type description - tableName: "fb$table_columns", - columnName: "internal_type", + }, &qualifiedRefPlanExpression{ // the SQL3 data type description + tableName: "fb_table_columns", + columnName: "type", columnIndex: 2, dataType: parser.NewDataTypeString(), - }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "created_at", + }, &qualifiedRefPlanExpression{ // the FeatureBase 'native' data type description + tableName: "fb_table_columns", + columnName: "internal_type", columnIndex: 3, - dataType: parser.NewDataTypeTimestamp(), - }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "keys", - columnIndex: 4, - dataType: parser.NewDataTypeBool(), - }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "cache_type", - columnIndex: 5, dataType: parser.NewDataTypeString(), }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "cache_size", - columnIndex: 6, - dataType: parser.NewDataTypeInt(), + tableName: "fb_table_columns", + columnName: "created_at", + columnIndex: 4, + dataType: parser.NewDataTypeTimestamp(), }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "scale", + tableName: "fb_table_columns", + columnName: "keys", + columnIndex: 5, + dataType: parser.NewDataTypeBool(), + }, &qualifiedRefPlanExpression{ + tableName: "fb_table_columns", + columnName: "cache_type", + columnIndex: 6, + dataType: parser.NewDataTypeString(), + }, &qualifiedRefPlanExpression{ + tableName: "fb_table_columns", + columnName: "cache_size", columnIndex: 7, dataType: parser.NewDataTypeInt(), }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "min", + tableName: "fb_table_columns", + columnName: "scale", columnIndex: 8, dataType: parser.NewDataTypeInt(), }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "max", + tableName: "fb_table_columns", + columnName: "min", columnIndex: 9, dataType: parser.NewDataTypeInt(), }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "timeunit", + tableName: "fb_table_columns", + columnName: "max", columnIndex: 10, - dataType: parser.NewDataTypeString(), - }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "epoch", - columnIndex: 11, dataType: parser.NewDataTypeInt(), }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "timequantum", - columnIndex: 12, + tableName: "fb_table_columns", + columnName: "timeunit", + columnIndex: 11, dataType: parser.NewDataTypeString(), }, &qualifiedRefPlanExpression{ - tableName: "fb$table_columns", - columnName: "ttl", + tableName: "fb_table_columns", + columnName: "epoch", + columnIndex: 12, + dataType: parser.NewDataTypeInt(), + }, &qualifiedRefPlanExpression{ + tableName: "fb_table_columns", + columnName: "timequantum", columnIndex: 13, dataType: parser.NewDataTypeString(), + }, &qualifiedRefPlanExpression{ + tableName: "fb_table_columns", + columnName: "ttl", + columnIndex: 14, + dataType: parser.NewDataTypeString(), }} return NewPlanOpQuery(p, NewPlanOpProjection(columns, NewPlanOpFeatureBaseColumns(index)), p.sql), nil } + +func (p *ExecutionPlanner) compileShowCreateTableStatement(stmt *parser.ShowCreateTableStatement) (_ types.PlanOperator, err error) { + tableName := parser.IdentName(stmt.TableName) + _, err = p.schemaAPI.IndexInfo(context.Background(), tableName) + if err != nil { + if errors.Is(err, pilosa.ErrIndexNotFound) { + return nil, sql3.NewErrTableNotFound(stmt.TableName.NamePos.Line, stmt.TableName.NamePos.Column, tableName) + } + return nil, err + } + + // get the system table + systemTable, ok := systemTables[fbTableDDL] + if !ok { + return nil, sql3.NewErrInternalf("unable to find system table fb_table_ddl") + } + + // make an op for the system table + systemTableScan := NewPlanOpSystemTable(p, systemTable) + + // get the columns from the schmema + columns := systemTable.schema + + // get the ref name column and build projections + projections := make([]types.PlanExpression, 0) + var nameRef *qualifiedRefPlanExpression + for idx, col := range columns { + if strings.EqualFold(col.ColumnName, "name") { + nameRef = newQualifiedRefPlanExpression(col.RelationName, col.ColumnName, idx, col.Type) + } + if strings.EqualFold(col.ColumnName, "ddl") { + projections = append(projections, newQualifiedRefPlanExpression(col.RelationName, col.ColumnName, idx, col.Type)) + } + } + if nameRef == nil || len(projections) == 0 { + return nil, sql3.NewErrInternalf("unable to find system table columns") + } + + // make a filter espression + filterExpr := newBinOpPlanExpression(nameRef, parser.EQ, newStringLiteralPlanExpression(tableName), parser.NewDataTypeBool()) + + // make a filter op + filter := NewPlanOpFilter(p, filterExpr, systemTableScan) + + return NewPlanOpQuery(p, NewPlanOpProjection(projections, filter), p.sql), nil +} diff --git a/sql3/planner/executionplanner.go b/sql3/planner/executionplanner.go index 1e1e74b95..49b5e8493 100644 --- a/sql3/planner/executionplanner.go +++ b/sql3/planner/executionplanner.go @@ -68,6 +68,8 @@ func (p *ExecutionPlanner) CompilePlan(ctx context.Context, stmt parser.Statemen rootOperator, err = p.compileShowTablesStatement(stmt) case *parser.ShowColumnsStatement: rootOperator, err = p.compileShowColumnsStatement(stmt) + case *parser.ShowCreateTableStatement: + rootOperator, err = p.compileShowCreateTableStatement(stmt) case *parser.CreateTableStatement: rootOperator, err = p.compileCreateTableStatement(stmt) case *parser.AlterTableStatement: @@ -96,6 +98,8 @@ func (p *ExecutionPlanner) analyzePlan(stmt parser.Statement) error { return nil case *parser.ShowColumnsStatement: return nil + case *parser.ShowCreateTableStatement: + return nil case *parser.CreateTableStatement: return p.analyzeCreateTableStatement(stmt) case *parser.AlterTableStatement: diff --git a/sql3/planner/expression.go b/sql3/planner/expression.go index 0a66de567..5ebbd3360 100644 --- a/sql3/planner/expression.go +++ b/sql3/planner/expression.go @@ -82,7 +82,7 @@ func coerceValue(sourceType parser.ExprDataType, targetType parser.ExprDataType, } else if tm, err := time.ParseInLocation("2006-01-02", val, time.UTC); err == nil { return tm, nil } else { - return nil, sql3.NewErrInvalidTypeCoercion(0, 0, val, targetType.TypeName()) + return nil, sql3.NewErrInvalidTypeCoercion(0, 0, val, targetType.TypeDescription()) } } @@ -126,7 +126,7 @@ func coerceValue(sourceType parser.ExprDataType, targetType parser.ExprDataType, default: return nil, sql3.NewErrInternalf("unhandled source type '%T'", sourceType) } - return nil, sql3.NewErrTypeMismatch(atPos.Line, atPos.Column, targetType.TypeName(), sourceType.TypeName()) + return nil, sql3.NewErrTypeMismatch(atPos.Line, atPos.Column, targetType.TypeDescription(), sourceType.TypeDescription()) } // unaryOpPlanExpression is a unary op @@ -173,7 +173,7 @@ func (n *unaryOpPlanExpression) String() string { func (n *unaryOpPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["op"] = n.op result["rhs"] = n.rhs.Plan() return result @@ -649,7 +649,7 @@ func (n *binOpPlanExpression) Evaluate(currentRow []interface{}) (interface{}, e return nil, sql3.NewErrInternalf("unexpected type conversion error '%t', '%t'", nlok, nrok) default: - return nil, sql3.NewErrInternalf("unhandled type '%s'", coercedDataType.TypeName()) + return nil, sql3.NewErrInternalf("unhandled type '%s'", coercedDataType.TypeDescription()) } } @@ -664,7 +664,7 @@ func (n *binOpPlanExpression) String() string { func (n *binOpPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["op"] = n.op result["lhs"] = n.lhs.Plan() result["rhs"] = n.rhs.Plan() @@ -735,7 +735,7 @@ func (n *rangePlanExpression) String() string { func (n *rangePlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["lhs"] = n.lhs.Plan() result["rhs"] = n.rhs.Plan() return result @@ -950,7 +950,7 @@ func (n *casePlanExpression) String() string { func (n *casePlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() if n.baseExpr != nil { result["baseExpr"] = n.baseExpr.Plan() } @@ -1035,7 +1035,7 @@ func (n *caseBlockPlanExpression) String() string { func (n *caseBlockPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["condition"] = n.condition.Plan() result["body"] = n.body.Plan() return result @@ -1104,7 +1104,7 @@ func (n *subqueryPlanExpression) String() string { func (n *subqueryPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["subquery"] = n.op.Plan() return result } @@ -1212,7 +1212,7 @@ func (n *betweenOpPlanExpression) String() string { func (n *betweenOpPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["lhs"] = n.lhs.Plan() result["rhs"] = n.rhs.Plan() return result @@ -1285,13 +1285,13 @@ func (n *inOpPlanExpression) Evaluate(currentRow []interface{}) (interface{}, er case *parser.DataTypeInt, *parser.DataTypeID: nl, nlok := evalLhs.(int64) if !nlok { - return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeDescription()) } for _, lm := range listMembers { l, lok := lm.(int64) if !lok { - return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeDescription()) } if nl == l { result = true @@ -1302,13 +1302,13 @@ func (n *inOpPlanExpression) Evaluate(currentRow []interface{}) (interface{}, er case *parser.DataTypeBool: nl, nlok := evalLhs.(bool) if !nlok { - return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeDescription()) } for _, lm := range listMembers { l, lok := lm.(bool) if !lok { - return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeDescription()) } if nl == l { result = true @@ -1319,13 +1319,13 @@ func (n *inOpPlanExpression) Evaluate(currentRow []interface{}) (interface{}, er case *parser.DataTypeDecimal: nl, nlok := evalLhs.(pql.Decimal) if !nlok { - return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeDescription()) } for _, lm := range listMembers { l, lok := lm.(pql.Decimal) if !lok { - return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeDescription()) } if nl.EqualTo(l) { result = true @@ -1336,13 +1336,13 @@ func (n *inOpPlanExpression) Evaluate(currentRow []interface{}) (interface{}, er case *parser.DataTypeIDSet: nl, nlok := evalLhs.([]int64) if !nlok { - return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeDescription()) } for _, lm := range listMembers { l, lok := lm.([]int64) if !lok { - return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeDescription()) } if intSetContainsAll(nl, l) { result = true @@ -1353,13 +1353,13 @@ func (n *inOpPlanExpression) Evaluate(currentRow []interface{}) (interface{}, er case *parser.DataTypeString: nl, nlok := evalLhs.(string) if !nlok { - return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeDescription()) } for _, lm := range listMembers { l, lok := lm.(string) if !lok { - return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeDescription()) } if nl == l { result = true @@ -1370,13 +1370,13 @@ func (n *inOpPlanExpression) Evaluate(currentRow []interface{}) (interface{}, er case *parser.DataTypeStringSet: nl, nlok := evalLhs.([]string) if !nlok { - return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeDescription()) } for _, lm := range listMembers { l, lok := lm.([]string) if !lok { - return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeDescription()) } if stringSetContainsAll(nl, l) { result = true @@ -1387,13 +1387,13 @@ func (n *inOpPlanExpression) Evaluate(currentRow []interface{}) (interface{}, er case *parser.DataTypeTimestamp: nl, nlok := evalLhs.(time.Time) if !nlok { - return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert lhs expression to type '%s'", n.lhs.Type().TypeDescription()) } for _, lm := range listMembers { l, lok := lm.(time.Time) if !lok { - return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeName()) + return nil, sql3.NewErrInternalf("unable to convert list expression to type '%s'", n.lhs.Type().TypeDescription()) } if nl == l { result = true @@ -1430,7 +1430,7 @@ func (n *inOpPlanExpression) String() string { func (n *inOpPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["lhs"] = n.lhs.Plan() result["rhs"] = n.rhs.Plan() return result @@ -1500,7 +1500,7 @@ func (n *callPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) result["name"] = n.name - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() ps := make([]interface{}, 0) for _, e := range n.args { ps = append(ps, e.Plan()) @@ -1555,7 +1555,7 @@ func (n *aliasPlanExpression) String() string { func (n *aliasPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["aliasName"] = n.aliasName result["expr"] = n.expr.Plan() return result @@ -1651,7 +1651,7 @@ func (n *qualifiedRefPlanExpression) Plan() map[string]interface{} { result["tableName"] = n.tableName result["columnName"] = n.columnName result["columnIndex"] = n.columnIndex - result["dataType"] = n.dataType.TypeName() + result["dataType"] = n.dataType.TypeDescription() return result } @@ -1711,7 +1711,7 @@ func (n *variableRefPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) result["name"] = n.name - result["dataType"] = n.dataType.TypeName() + result["dataType"] = n.dataType.TypeDescription() return result } @@ -1745,7 +1745,7 @@ func (n *nullLiteralPlanExpression) String() string { func (n *nullLiteralPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() return result } @@ -1783,7 +1783,7 @@ func (n *intLiteralPlanExpression) String() string { func (n *intLiteralPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["value"] = n.value return result } @@ -1823,7 +1823,7 @@ func (n *floatLiteralPlanExpression) String() string { func (n *floatLiteralPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["value"] = n.value return result } @@ -1862,7 +1862,7 @@ func (n *boolLiteralPlanExpression) String() string { func (n *boolLiteralPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["value"] = n.value return result } @@ -1901,7 +1901,7 @@ func (n *dateLiteralPlanExpression) String() string { func (n *dateLiteralPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["value"] = n.value return result } @@ -1940,7 +1940,7 @@ func (n *stringLiteralPlanExpression) String() string { func (n *stringLiteralPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["value"] = n.value return result } @@ -2158,13 +2158,13 @@ func (n *castPlanExpression) Type() parser.ExprDataType { } func (n *castPlanExpression) String() string { - return fmt.Sprintf("cast(%s as %s)", n.lhs.String(), n.targetType.TypeName()) + return fmt.Sprintf("cast(%s as %s)", n.lhs.String(), n.targetType.TypeDescription()) } func (n *castPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["lhs"] = n.lhs.Plan() return result } @@ -2346,7 +2346,7 @@ func (n *exprTupleLiteralPlanExpression) Evaluate(currentRow []interface{}) (int // if it is a string, do a coercion if val, ok := timestampEval.(string); ok { if tm, err := timestampFromString(val); err != nil { - return nil, sql3.NewErrInvalidTypeCoercion(0, 0, val, n.members[0].Type().TypeName()) + return nil, sql3.NewErrInvalidTypeCoercion(0, 0, val, n.members[0].Type().TypeDescription()) } else { timestampEval = tm } diff --git a/sql3/planner/expression_it_test.go b/sql3/planner/expression_it_test.go index 41f1c4ac8..ce840d0a8 100644 --- a/sql3/planner/expression_it_test.go +++ b/sql3/planner/expression_it_test.go @@ -68,7 +68,7 @@ func TestExpressions(t *testing.T) { assert.Equal(t, slop.String(), "'foo'") ctop := newCastPlanExpression(newIntLiteralPlanExpression(10), parser.NewDataTypeString()) - assert.Equal(t, ctop.String(), "cast(10 as STRING)") + assert.Equal(t, ctop.String(), "cast(10 as string)") elop := newExprListExpression([]types.PlanExpression{newStringLiteralPlanExpression("foo"), newStringLiteralPlanExpression("bar")}) assert.Equal(t, elop.String(), "('foo', 'bar')") diff --git a/sql3/planner/expressionagg.go b/sql3/planner/expressionagg.go index 8d827df10..9eeabe22a 100644 --- a/sql3/planner/expressionagg.go +++ b/sql3/planner/expressionagg.go @@ -126,7 +126,7 @@ func (n *countPlanExpression) String() string { func (n *countPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["arg"] = n.arg.Plan() return result } @@ -194,7 +194,7 @@ func (n *countDistinctPlanExpression) String() string { func (n *countDistinctPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["arg"] = n.arg.Plan() return result } @@ -327,7 +327,7 @@ func (n *sumPlanExpression) String() string { func (n *sumPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["arg"] = n.arg.Plan() return result } @@ -500,7 +500,7 @@ func (n *avgPlanExpression) String() string { func (n *avgPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["arg"] = n.arg.Plan() return result } @@ -641,7 +641,7 @@ func (n *minPlanExpression) String() string { func (n *minPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["arg"] = n.arg.Plan() return result } @@ -783,7 +783,7 @@ func (n *maxPlanExpression) String() string { func (n *maxPlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["arg"] = n.arg.Plan() return result } @@ -855,7 +855,7 @@ func (n *percentilePlanExpression) String() string { func (n *percentilePlanExpression) Plan() map[string]interface{} { result := make(map[string]interface{}) result["_expr"] = fmt.Sprintf("%T", n) - result["dataType"] = n.Type().TypeName() + result["dataType"] = n.Type().TypeDescription() result["arg"] = n.arg.Plan() result["ntharg"] = n.nthArg.Plan() return result diff --git a/sql3/planner/expressionanalyzer.go b/sql3/planner/expressionanalyzer.go index 387aee5a2..1b1c2bac5 100644 --- a/sql3/planner/expressionanalyzer.go +++ b/sql3/planner/expressionanalyzer.go @@ -279,14 +279,14 @@ func (p *ExecutionPlanner) analyzeExpression(expr parser.Expr, scope parser.Stat //now check all the other blocks to make sure that each body is assignment compatible with that type for _, blk := range e.Blocks { if !typesAreAssignmentCompatible(caseType, blk.Body.DataType()) { - return nil, sql3.NewErrTypeAssignmentIncompatible(blk.Body.Pos().Line, blk.Body.Pos().Column, caseType.TypeName(), blk.Body.DataType().TypeName()) + return nil, sql3.NewErrTypeAssignmentIncompatible(blk.Body.Pos().Line, blk.Body.Pos().Column, caseType.TypeDescription(), blk.Body.DataType().TypeDescription()) } } //if there is an else check that too if e.ElseExpr != nil { if !typesAreAssignmentCompatible(caseType, e.ElseExpr.DataType()) { - return nil, sql3.NewErrTypeAssignmentIncompatible(e.ElseExpr.Pos().Line, e.ElseExpr.Pos().Column, caseType.TypeName(), e.ElseExpr.DataType().TypeName()) + return nil, sql3.NewErrTypeAssignmentIncompatible(e.ElseExpr.Pos().Line, e.ElseExpr.Pos().Column, caseType.TypeDescription(), e.ElseExpr.DataType().TypeDescription()) } } @@ -720,7 +720,7 @@ func (p *ExecutionPlanner) analyzeRangeExpression(expr *parser.Range, scope pars return nil, sql3.NewErrTypeCannotBeUsedAsRangeSubscript(expr.Y.Pos().Line, expr.Y.Pos().Column, expr.Y.DataType().TypeDescription()) } if !typesOfRangeBoundsAreTheSame(expr.X.DataType(), expr.Y.DataType()) { - return nil, sql3.NewErrIncompatibleTypesForRangeSubscripts(expr.Pos().Line, expr.Pos().Column, expr.X.DataType().TypeName(), expr.Y.DataType().TypeName()) + return nil, sql3.NewErrIncompatibleTypesForRangeSubscripts(expr.Pos().Line, expr.Pos().Column, expr.X.DataType().TypeDescription(), expr.Y.DataType().TypeDescription()) } expr.ResultDataType = parser.NewDataTypeRange(expr.X.DataType()) diff --git a/sql3/planner/expressionanalyzercall.go b/sql3/planner/expressionanalyzercall.go index c8ba24b16..8581df641 100644 --- a/sql3/planner/expressionanalyzercall.go +++ b/sql3/planner/expressionanalyzercall.go @@ -130,7 +130,7 @@ func (p *ExecutionPlanner) analyzeCallExpression(call *parser.Call, scope parser //second column is the nth value targetType := parser.NewDataTypeDecimal(4) if !typesAreAssignmentCompatible(targetType, call.Args[1].DataType()) { - return nil, sql3.NewErrParameterTypeMistmatch(call.Args[1].Pos().Line, call.Args[1].Pos().Column, targetType.TypeName(), call.Args[1].DataType().TypeName()) + return nil, sql3.NewErrParameterTypeMistmatch(call.Args[1].Pos().Line, call.Args[1].Pos().Column, targetType.TypeDescription(), call.Args[1].DataType().TypeDescription()) } //make sure it's literal diff --git a/sql3/planner/expressionpql.go b/sql3/planner/expressionpql.go index 8ab8b0d47..b425aacfb 100644 --- a/sql3/planner/expressionpql.go +++ b/sql3/planner/expressionpql.go @@ -225,7 +225,7 @@ func (p *ExecutionPlanner) generatePQLCallFromBinaryExpr(ctx context.Context, ex if strings.EqualFold(lhs.columnName, "_id") { return nil, sql3.NewErrInvalidColumnInFilterExpression(0, 0, "_id", "is/is not null") } - return nil, sql3.NewErrInvalidTypeInFilterExpression(0, 0, typ.TypeName(), "is/is not null") + return nil, sql3.NewErrInvalidTypeInFilterExpression(0, 0, typ.TypeDescription(), "is/is not null") case *parser.DataTypeInt, *parser.DataTypeDecimal, *parser.DataTypeTimestamp: return &pql.Call{ @@ -239,7 +239,7 @@ func (p *ExecutionPlanner) generatePQLCallFromBinaryExpr(ctx context.Context, ex }, nil default: - return nil, sql3.NewErrInvalidTypeInFilterExpression(0, 0, typ.TypeName(), "is/is not null") + return nil, sql3.NewErrInvalidTypeInFilterExpression(0, 0, typ.TypeDescription(), "is/is not null") } case parser.BETWEEN, parser.NOTBETWEEN: diff --git a/sql3/planner/expressiontypes.go b/sql3/planner/expressiontypes.go index 5554cd423..1ad883a75 100644 --- a/sql3/planner/expressiontypes.go +++ b/sql3/planner/expressiontypes.go @@ -6,9 +6,10 @@ import ( "strconv" "strings" - pilosa "github.com/featurebasedb/featurebase/v3" - "github.com/featurebasedb/featurebase/v3/sql3" - "github.com/featurebasedb/featurebase/v3/sql3/parser" + pilosa "github.com/molecula/featurebase/v3" + "github.com/molecula/featurebase/v3/dax" + "github.com/molecula/featurebase/v3/sql3" + "github.com/molecula/featurebase/v3/sql3/parser" ) // takes a *pilosa.FieldInfo and returns a sql data type @@ -75,33 +76,33 @@ func fieldSQLDataType(f *pilosa.FieldInfo) parser.ExprDataType { // resolves type names to type representations func dataTypeFromParserType(typ *parser.Type) (parser.ExprDataType, error) { typeName := parser.IdentName(typ.Name) - switch strings.ToUpper(typeName) { - case parser.FieldTypeBool: + switch strings.ToLower(typeName) { + case dax.BaseTypeBool: return parser.NewDataTypeBool(), nil - case parser.FieldTypeDecimal: + case dax.BaseTypeDecimal: scale, err := strconv.Atoi(typ.Scale.Value) if err != nil { return nil, err } return parser.NewDataTypeDecimal(int64(scale)), nil - case parser.FieldTypeID: + case dax.BaseTypeID: return parser.NewDataTypeID(), nil - case parser.FieldTypeIDSet: + case dax.BaseTypeIDSet: return parser.NewDataTypeIDSet(), nil - case parser.FieldTypeInt: + case dax.BaseTypeInt: return parser.NewDataTypeInt(), nil - case parser.FieldTypeString: + case dax.BaseTypeString: return parser.NewDataTypeString(), nil - case parser.FieldTypeStringSet: + case dax.BaseTypeStringSet: return parser.NewDataTypeStringSet(), nil - case parser.FieldTypeTimestamp: + case dax.BaseTypeTimestamp: return parser.NewDataTypeTimestamp(), nil default: @@ -603,7 +604,7 @@ func typesCoercedForArithmeticOperator(testTypeL parser.ExprDataType, testTypeR } } - return nil, sql3.NewErrTypeMismatch(atPos.Line, atPos.Column, testTypeL.TypeName(), testTypeR.TypeName()) + return nil, sql3.NewErrTypeMismatch(atPos.Line, atPos.Column, testTypeL.TypeDescription(), testTypeR.TypeDescription()) } // returns the target type given two operand types for a bitwise operation (or an error) @@ -635,7 +636,7 @@ func typesCoercedForBitwiseOperator(testTypeL parser.ExprDataType, testTypeR par return parser.NewDataTypeDecimal(rhsType.Scale), nil } } - return nil, sql3.NewErrTypeMismatch(atPos.Line, atPos.Column, testTypeL.TypeName(), testTypeR.TypeName()) + return nil, sql3.NewErrTypeMismatch(atPos.Line, atPos.Column, testTypeL.TypeDescription(), testTypeR.TypeDescription()) } // returns the target type given two operand types type coercion operation (or an error) @@ -709,7 +710,7 @@ func typeCoerceType(testTypeL parser.ExprDataType, testTypeR parser.ExprDataType default: return nil, sql3.NewErrInternalf("unhandled lhs type '%t'", testTypeL) } - return nil, sql3.NewErrTypeMismatch(atPos.Line, atPos.Line, testTypeL.TypeName(), testTypeR.TypeName()) + return nil, sql3.NewErrTypeMismatch(atPos.Line, atPos.Line, testTypeL.TypeDescription(), testTypeR.TypeDescription()) } // returns true if source type can be cast to target type diff --git a/sql3/planner/inbuiltfunctionsdate.go b/sql3/planner/inbuiltfunctionsdate.go index 1522bd7e7..4149893f8 100644 --- a/sql3/planner/inbuiltfunctionsdate.go +++ b/sql3/planner/inbuiltfunctionsdate.go @@ -28,13 +28,13 @@ func (p *ExecutionPlanner) analyzeFunctionDatePart(call *parser.Call, scope pars // interval intervalType := parser.NewDataTypeString() if !typesAreAssignmentCompatible(intervalType, call.Args[0].DataType()) { - return nil, sql3.NewErrParameterTypeMistmatch(call.Args[0].Pos().Line, call.Args[0].Pos().Column, call.Args[0].DataType().TypeName(), intervalType.TypeName()) + return nil, sql3.NewErrParameterTypeMistmatch(call.Args[0].Pos().Line, call.Args[0].Pos().Column, call.Args[0].DataType().TypeDescription(), intervalType.TypeDescription()) } // date dateType := parser.NewDataTypeTimestamp() if !typesAreAssignmentCompatible(dateType, call.Args[1].DataType()) { - return nil, sql3.NewErrParameterTypeMistmatch(call.Args[1].Pos().Line, call.Args[1].Pos().Column, call.Args[1].DataType().TypeName(), dateType.TypeName()) + return nil, sql3.NewErrParameterTypeMistmatch(call.Args[1].Pos().Line, call.Args[1].Pos().Column, call.Args[1].DataType().TypeDescription(), dateType.TypeDescription()) } //return int diff --git a/sql3/planner/opbulkinsert.go b/sql3/planner/opbulkinsert.go index ac295d564..64d04bd63 100644 --- a/sql3/planner/opbulkinsert.go +++ b/sql3/planner/opbulkinsert.go @@ -76,7 +76,7 @@ func (p *PlanOpBulkInsert) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc result["tableName"] = p.tableName @@ -99,7 +99,7 @@ func (p *PlanOpBulkInsert) Plan() map[string]interface{} { for _, m := range p.options.mapExpressions { mapItem := make(map[string]interface{}) options["name"] = m.name - options["type"] = m.colType.TypeName() + options["type"] = m.colType.TypeDescription() options["expr"] = m.expr.Plan() mapList = append(mapList, mapItem) } @@ -274,15 +274,15 @@ func (i *bulkInsertSourceCSVRowIter) Next(ctx context.Context) (types.Row, error case *parser.DataTypeID, *parser.DataTypeInt: intVal, err := strconv.ParseInt(evalValue, 10, 64) if err != nil { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeDescription()) } result[idx] = intVal case *parser.DataTypeIDSet: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeDescription()) case *parser.DataTypeStringSet: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeDescription()) case *parser.DataTypeTimestamp: intVal, err := strconv.ParseInt(evalValue, 10, 64) @@ -294,7 +294,7 @@ func (i *bulkInsertSourceCSVRowIter) Next(ctx context.Context) (types.Row, error } else if tm, err := time.ParseInLocation("2006-01-02", evalValue, time.UTC); err == nil { result[idx] = tm } else { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeDescription()) } } result[idx] = time.UnixMilli(intVal).UTC() @@ -305,14 +305,14 @@ func (i *bulkInsertSourceCSVRowIter) Next(ctx context.Context) (types.Row, error case *parser.DataTypeBool: bval, err := strconv.ParseInt(evalValue, 10, 64) if err != nil { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeDescription()) } result[idx] = bval case *parser.DataTypeDecimal: dval, err := pql.ParseDecimal(evalValue) if err != nil { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, evalValue, mapColumn.colType.TypeDescription()) } result[idx] = dval @@ -494,24 +494,24 @@ func (i *bulkInsertSourceNDJsonRowIter) Next(ctx context.Context) (types.Row, er if v == float64(int64(v)) { result[idx] = int64(v) } else { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) } case []interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case string: intVal, err := strconv.ParseInt(v, 10, 64) if err != nil { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) } result[idx] = intVal case bool: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) default: return nil, sql3.NewErrInternalf("unhandled type '%T'", evalValue) @@ -520,31 +520,31 @@ func (i *bulkInsertSourceNDJsonRowIter) Next(ctx context.Context) (types.Row, er case *parser.DataTypeIDSet: switch v := evalValue.(type) { case float64: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case []interface{}: setValue := make([]int64, 0) for _, i := range v { f, ok := i.(float64) if !ok { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) } if f == float64(int64(f)) { setValue = append(setValue, int64(f)) } else { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) } } result[idx] = setValue case string: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case bool: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) default: return nil, sql3.NewErrInternalf("unhandled type '%T'", evalValue) @@ -553,27 +553,27 @@ func (i *bulkInsertSourceNDJsonRowIter) Next(ctx context.Context) (types.Row, er case *parser.DataTypeStringSet: switch v := evalValue.(type) { case float64: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case []interface{}: setValue := make([]string, 0) for _, i := range v { f, ok := i.(string) if !ok { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) } setValue = append(setValue, f) } result[idx] = setValue case string: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case bool: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) default: return nil, sql3.NewErrInternalf("unhandled type '%T'", evalValue) @@ -586,11 +586,11 @@ func (i *bulkInsertSourceNDJsonRowIter) Next(ctx context.Context) (types.Row, er if v == float64(int64(v)) { result[idx] = time.UnixMilli(int64(v)).UTC() } else { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) } case []interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case string: if tm, err := time.ParseInLocation(time.RFC3339Nano, v, time.UTC); err == nil { @@ -600,14 +600,14 @@ func (i *bulkInsertSourceNDJsonRowIter) Next(ctx context.Context) (types.Row, er } else if tm, err := time.ParseInLocation("2006-01-02", v, time.UTC); err == nil { result[idx] = tm } else { - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) } case bool: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) default: return nil, sql3.NewErrInternalf("unhandled type '%T'", evalValue) @@ -616,19 +616,19 @@ func (i *bulkInsertSourceNDJsonRowIter) Next(ctx context.Context) (types.Row, er case *parser.DataTypeString: switch v := evalValue.(type) { case float64: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case []interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case string: result[idx] = v case bool: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) default: return nil, sql3.NewErrInternalf("unhandled type '%T'", evalValue) @@ -637,19 +637,19 @@ func (i *bulkInsertSourceNDJsonRowIter) Next(ctx context.Context) (types.Row, er case *parser.DataTypeBool: switch v := evalValue.(type) { case float64: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case []interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case string: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case bool: result[idx] = v case interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) default: return nil, sql3.NewErrInternalf("unhandled type '%T'", evalValue) @@ -661,16 +661,16 @@ func (i *bulkInsertSourceNDJsonRowIter) Next(ctx context.Context) (types.Row, er result[idx] = pql.FromFloat64(v) case []interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case string: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case bool: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) case interface{}: - return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeName()) + return nil, sql3.NewErrTypeConversionOnMap(0, 0, v, mapColumn.colType.TypeDescription()) default: return nil, sql3.NewErrInternalf("unhandled type '%T'", evalValue) diff --git a/sql3/planner/opcreatetable.go b/sql3/planner/opcreatetable.go index afbca6519..ae00df00d 100644 --- a/sql3/planner/opcreatetable.go +++ b/sql3/planner/opcreatetable.go @@ -39,7 +39,7 @@ func (p *PlanOpCreateTable) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) ps := make([]string, 0) for _, e := range p.Schema() { - ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = ps result["name"] = p.tableName diff --git a/sql3/planner/opdroptable.go b/sql3/planner/opdroptable.go index 4c8f6e273..4ab7eff1b 100644 --- a/sql3/planner/opdroptable.go +++ b/sql3/planner/opdroptable.go @@ -30,7 +30,7 @@ func (p *PlanOpDropTable) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) ps := make([]string, 0) for _, e := range p.Schema() { - ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = ps result["tableName"] = p.index.Name diff --git a/sql3/planner/opfeaturebasecolumns.go b/sql3/planner/opfeaturebasecolumns.go index aacac1434..71cbcf3fc 100644 --- a/sql3/planner/opfeaturebasecolumns.go +++ b/sql3/planner/opfeaturebasecolumns.go @@ -31,7 +31,7 @@ func (p *PlanOpFeatureBaseColumns) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) ps := make([]string, 0) for _, e := range p.Schema() { - ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = ps return result @@ -52,72 +52,77 @@ func (p *PlanOpFeatureBaseColumns) Warnings() []string { func (p *PlanOpFeatureBaseColumns) Schema() types.Schema { return types.Schema{ &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", + ColumnName: "_id", + Type: parser.NewDataTypeString(), + }, + &types.PlannerColumn{ + RelationName: "fb_table_columns", ColumnName: "name", Type: parser.NewDataTypeString(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "type", Type: parser.NewDataTypeString(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "internal_type", Type: parser.NewDataTypeString(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "created_at", Type: parser.NewDataTypeTimestamp(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "keys", Type: parser.NewDataTypeBool(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "cache_type", Type: parser.NewDataTypeString(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "cache_size", Type: parser.NewDataTypeInt(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "scale", Type: parser.NewDataTypeInt(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "min", Type: parser.NewDataTypeInt(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "max", Type: parser.NewDataTypeInt(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "timeunit", Type: parser.NewDataTypeString(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "epoch", Type: parser.NewDataTypeInt(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "timequantum", Type: parser.NewDataTypeString(), }, &types.PlannerColumn{ - RelationName: "fb$table_columns", + RelationName: "fb_table_columns", ColumnName: "ttl", Type: parser.NewDataTypeInt(), }, @@ -153,7 +158,8 @@ func (i *showColumnsRowIter) Next(ctx context.Context) (types.Row, error) { row := []interface{}{ fields[i.rowIndex].Name, - fieldSQLDataType(fields[i.rowIndex]).TypeName(), + fields[i.rowIndex].Name, + fieldSQLDataType(fields[i.rowIndex]).TypeDescription(), fields[i.rowIndex].Options.Type, tm.Format(time.RFC3339), fields[i.rowIndex].Options.Keys, diff --git a/sql3/planner/opfeaturebasetables.go b/sql3/planner/opfeaturebasetables.go index af15181a3..64373af16 100644 --- a/sql3/planner/opfeaturebasetables.go +++ b/sql3/planner/opfeaturebasetables.go @@ -31,7 +31,7 @@ func (p *PlanOpFeatureBaseTables) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) ps := make([]string, 0) for _, e := range p.Schema() { - ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = ps return result @@ -52,30 +52,50 @@ func (p *PlanOpFeatureBaseTables) Warnings() []string { func (p *PlanOpFeatureBaseTables) Schema() types.Schema { return types.Schema{ &types.PlannerColumn{ - RelationName: "fb$tables", + RelationName: "fb_tables", + ColumnName: "_id", + Type: parser.NewDataTypeString(), + }, + &types.PlannerColumn{ + RelationName: "fb_tables", ColumnName: "name", Type: parser.NewDataTypeString(), }, &types.PlannerColumn{ - RelationName: "fb$tables", + RelationName: "fb_tables", + ColumnName: "owner", + Type: parser.NewDataTypeString(), + }, + &types.PlannerColumn{ + RelationName: "fb_tables", + ColumnName: "last_updated_user", + Type: parser.NewDataTypeString(), + }, + &types.PlannerColumn{ + RelationName: "fb_tables", ColumnName: "created_at", Type: parser.NewDataTypeTimestamp(), }, &types.PlannerColumn{ - RelationName: "fb$tables", + RelationName: "fb_tables", ColumnName: "track_existence", Type: parser.NewDataTypeBool(), }, &types.PlannerColumn{ - RelationName: "fb$tables", + RelationName: "fb_tables", ColumnName: "keys", Type: parser.NewDataTypeBool(), }, &types.PlannerColumn{ - RelationName: "fb$tables", + RelationName: "fb_tables", ColumnName: "shard_width", Type: parser.NewDataTypeInt(), }, + &types.PlannerColumn{ + RelationName: "fb_tables", + ColumnName: "description", + Type: parser.NewDataTypeString(), + }, } } @@ -105,10 +125,14 @@ func (i *showTablesRowIter) Next(ctx context.Context) (types.Row, error) { tm := time.Unix(0, i.indexInfo[i.rowIndex].CreatedAt) row := []interface{}{ i.indexInfo[i.rowIndex].Name, + i.indexInfo[i.rowIndex].Name, + i.indexInfo[i.rowIndex].Owner, + i.indexInfo[i.rowIndex].LastUpdateUser, tm.Format(time.RFC3339), i.indexInfo[i.rowIndex].Options.TrackExistence, i.indexInfo[i.rowIndex].Options.Keys, i.indexInfo[i.rowIndex].ShardWidth, + i.indexInfo[i.rowIndex].Options.Description, } i.rowIndex += 1 return row, nil diff --git a/sql3/planner/opfilter.go b/sql3/planner/opfilter.go index 69b042b82..b4329122f 100644 --- a/sql3/planner/opfilter.go +++ b/sql3/planner/opfilter.go @@ -58,7 +58,7 @@ func (p *PlanOpFilter) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) ps := make([]string, 0) for _, e := range p.Schema() { - ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = ps result["predicate"] = p.Predicate.Plan() diff --git a/sql3/planner/opgroupby.go b/sql3/planner/opgroupby.go index 5d3e5c609..aac4c811b 100644 --- a/sql3/planner/opgroupby.go +++ b/sql3/planner/opgroupby.go @@ -102,7 +102,7 @@ func (p *PlanOpGroupBy) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc result["child"] = p.ChildOp.Plan() diff --git a/sql3/planner/opinsert.go b/sql3/planner/opinsert.go index 8912f49f5..aea935e95 100644 --- a/sql3/planner/opinsert.go +++ b/sql3/planner/opinsert.go @@ -39,7 +39,7 @@ func (p *PlanOpInsert) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc result["tableName"] = p.tableName diff --git a/sql3/planner/opnestedloops.go b/sql3/planner/opnestedloops.go index ee40c4ef7..7fe91dcca 100644 --- a/sql3/planner/opnestedloops.go +++ b/sql3/planner/opnestedloops.go @@ -33,7 +33,7 @@ func (p *PlanOpNestedLoops) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) ps := make([]string, 0) for _, e := range p.Schema() { - ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = ps result["top"] = p.top.Plan() diff --git a/sql3/planner/opnulltable.go b/sql3/planner/opnulltable.go index a808f6516..f6a861106 100644 --- a/sql3/planner/opnulltable.go +++ b/sql3/planner/opnulltable.go @@ -42,7 +42,7 @@ func (p *PlanOpNullTable) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) ps := make([]string, 0) for _, e := range p.Schema() { - ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = ps return result diff --git a/sql3/planner/oporderby.go b/sql3/planner/oporderby.go index f329d8264..a532f98a8 100644 --- a/sql3/planner/oporderby.go +++ b/sql3/planner/oporderby.go @@ -88,7 +88,7 @@ func (n *PlanOpOrderBy) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", n) sc := make([]string, 0) for _, e := range n.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc @@ -97,7 +97,7 @@ func (n *PlanOpOrderBy) Plan() map[string]interface{} { for _, e := range n.orderByFields { ps = append(ps, &map[string]interface{}{ "index": e.Index, - "exprType": e.ExprType.TypeName(), + "exprType": e.ExprType.TypeDescription(), "order": e.Order, "nullOrdering": e.NullOrdering, }) diff --git a/sql3/planner/oppqlaggregate.go b/sql3/planner/oppqlaggregate.go index abf9013ac..0867ce24f 100644 --- a/sql3/planner/oppqlaggregate.go +++ b/sql3/planner/oppqlaggregate.go @@ -38,7 +38,7 @@ func (p *PlanOpPQLAggregate) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) ps := make([]string, 0) for _, e := range p.Schema() { - ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = ps result["tableName"] = p.tableName diff --git a/sql3/planner/oppqlgroupby.go b/sql3/planner/oppqlgroupby.go index 679727cdb..71f01f502 100644 --- a/sql3/planner/oppqlgroupby.go +++ b/sql3/planner/oppqlgroupby.go @@ -40,7 +40,7 @@ func (p *PlanOpPQLGroupBy) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc result["tableName"] = p.tableName diff --git a/sql3/planner/oppqlmultiaggregate.go b/sql3/planner/oppqlmultiaggregate.go index 71d7c9ba1..53712fdf0 100644 --- a/sql3/planner/oppqlmultiaggregate.go +++ b/sql3/planner/oppqlmultiaggregate.go @@ -29,7 +29,7 @@ func (p *PlanOpPQLMultiAggregate) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc diff --git a/sql3/planner/oppqlmultigroupby.go b/sql3/planner/oppqlmultigroupby.go index 47d71cec2..46ba9cbae 100644 --- a/sql3/planner/oppqlmultigroupby.go +++ b/sql3/planner/oppqlmultigroupby.go @@ -35,7 +35,7 @@ func (p *PlanOpPQLMultiGroupBy) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc diff --git a/sql3/planner/oppqltablescan.go b/sql3/planner/oppqltablescan.go index f267e1fd7..1b0312a49 100644 --- a/sql3/planner/oppqltablescan.go +++ b/sql3/planner/oppqltablescan.go @@ -39,7 +39,7 @@ func (p *PlanOpPQLTableScan) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc diff --git a/sql3/planner/opprojection.go b/sql3/planner/opprojection.go index 5ed6e1908..d3c99fd37 100644 --- a/sql3/planner/opprojection.go +++ b/sql3/planner/opprojection.go @@ -63,7 +63,7 @@ func (p *PlanOpProjection) Plan() map[string]interface{} { result["__op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["__schema"] = sc diff --git a/sql3/planner/opquery.go b/sql3/planner/opquery.go index 8a7165c82..3bda9390e 100644 --- a/sql3/planner/opquery.go +++ b/sql3/planner/opquery.go @@ -77,7 +77,7 @@ func (p *PlanOpQuery) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc diff --git a/sql3/planner/oprelalias.go b/sql3/planner/oprelalias.go index 3ced6a84f..98fd7aa41 100644 --- a/sql3/planner/oprelalias.go +++ b/sql3/planner/oprelalias.go @@ -55,7 +55,7 @@ func (p *PlanOpRelAlias) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc diff --git a/sql3/planner/opsubquery.go b/sql3/planner/opsubquery.go index d282ae7bb..d2259663c 100644 --- a/sql3/planner/opsubquery.go +++ b/sql3/planner/opsubquery.go @@ -45,7 +45,7 @@ func (p *PlanOpSubquery) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc diff --git a/sql3/planner/opsystemtable.go b/sql3/planner/opsystemtable.go index 12d23d090..182f015b6 100644 --- a/sql3/planner/opsystemtable.go +++ b/sql3/planner/opsystemtable.go @@ -3,38 +3,25 @@ package planner import ( + "bytes" "context" "fmt" - pilosa "github.com/featurebasedb/featurebase/v3" - "github.com/featurebasedb/featurebase/v3/sql3" - "github.com/featurebasedb/featurebase/v3/sql3/parser" - "github.com/featurebasedb/featurebase/v3/sql3/planner/types" + pilosa "github.com/molecula/featurebase/v3" + "github.com/molecula/featurebase/v3/pql" + "github.com/molecula/featurebase/v3/sql3" + "github.com/molecula/featurebase/v3/sql3/parser" + "github.com/molecula/featurebase/v3/sql3/planner/types" ) -//fb_exec_requests -// session -// user -// start_time -// end_time -// status -// plan -// wait_type -// wait_time -// wait_resource -// cpu_time -// elapsed_time -// reads -// writes -// logical_reads -// row_count - // exclude this file from SonarCloud dupe eval const ( fbClusterInfo = "fb_cluster_info" fbClusterNodes = "fb_cluster_nodes" fbExecRequests = "fb_exec_requests" + + fbTableDDL = "fb_table_ddl" ) type systemTable struct { @@ -209,6 +196,27 @@ var systemTables = map[string]*systemTable{ }, }, }, + + fbTableDDL: { + name: fbTableDDL, + schema: types.Schema{ + &types.PlannerColumn{ + RelationName: fbTableDDL, + ColumnName: "id", + Type: parser.NewDataTypeString(), + }, + &types.PlannerColumn{ + RelationName: fbTableDDL, + ColumnName: "name", + Type: parser.NewDataTypeString(), + }, + &types.PlannerColumn{ + RelationName: fbTableDDL, + ColumnName: "ddl", + Type: parser.NewDataTypeString(), + }, + }, + }, } // PlanOpSystemTable handles system tables @@ -231,7 +239,7 @@ func (p *PlanOpSystemTable) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) ps := make([]string, 0) for _, e := range p.Schema() { - ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + ps = append(ps, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = ps return result @@ -271,6 +279,10 @@ func (p *PlanOpSystemTable) Iterator(ctx context.Context, row types.Row) (types. return &fbExecRequestsRowIter{ planner: p.planner, }, nil + case fbTableDDL: + return &fbTableDDLRowIter{ + planner: p.planner, + }, nil default: return nil, sql3.NewErrInternalf("unable to find system table '%s'", p.table.name) } @@ -379,3 +391,136 @@ func (i *fbExecRequestsRowIter) Next(ctx context.Context) (types.Row, error) { } return nil, types.ErrNoMoreRows } + +type fbTableDDLRow struct { + id string + name string + ddl string +} + +type fbTableDDLRowIter struct { + planner *ExecutionPlanner + result []*fbTableDDLRow +} + +var _ types.RowIterator = (*fbTableDDLRowIter)(nil) + +func (i *fbTableDDLRowIter) Next(ctx context.Context) (types.Row, error) { + if i.result == nil { + schema, err := i.planner.schemaAPI.Schema(ctx, false) + if err != nil { + return nil, err + } + i.result = make([]*fbTableDDLRow, len(schema)) + + for idx, table := range schema { + + index, err := i.planner.schemaAPI.IndexInfo(context.Background(), table.Name) + if err != nil { + return nil, err + } + + // build the ddl for this table + + var buf bytes.Buffer + buf.WriteString("create table ") + fmt.Fprintf(&buf, "%s", index.Name) + buf.WriteString(" (") + + for idx, col := range index.Fields { + if idx > 0 { + buf.WriteString(", ") + } + fmt.Fprintf(&buf, "%s", col.Name) + dataType := fieldSQLDataType(col) + fmt.Fprintf(&buf, " %s", dataType.TypeDescription()) + + switch dt := dataType.(type) { + case *parser.DataTypeID, *parser.DataTypeString: + if col.Options.CacheType != pilosa.DefaultCacheType && len(col.Options.CacheType) > 0 { + fmt.Fprintf(&buf, " cachetype %s", col.Options.CacheType) + } + if col.Options.CacheSize != pilosa.DefaultCacheSize && col.Options.CacheSize > 0 { + fmt.Fprintf(&buf, " cachesize %d", col.Options.CacheSize) + } + + case *parser.DataTypeIDSet, *parser.DataTypeStringSet: + if col.Options.CacheType != pilosa.DefaultCacheType && len(col.Options.CacheType) > 0 { + fmt.Fprintf(&buf, " cachetype %s", col.Options.CacheType) + } + if col.Options.CacheSize != pilosa.DefaultCacheSize && col.Options.CacheSize > 0 { + fmt.Fprintf(&buf, " cachesize %d", col.Options.CacheSize) + } + + case *parser.DataTypeIDSetQuantum, *parser.DataTypeStringSetQuantum: + if col.Options.CacheType != pilosa.DefaultCacheType && len(col.Options.CacheType) > 0 { + fmt.Fprintf(&buf, " cachetype %s", col.Options.CacheType) + } + if col.Options.CacheSize != pilosa.DefaultCacheSize && col.Options.CacheSize > 0 { + fmt.Fprintf(&buf, " cachesize %d", col.Options.CacheSize) + } + if !col.Options.TimeQuantum.IsEmpty() { + fmt.Fprintf(&buf, " timequantum '%s'", col.Options.TimeQuantum) + } + if col.Options.TTL > 0 { + fmt.Fprintf(&buf, " ttl '%s'", col.Options.TTL.String()) + } + + case *parser.DataTypeInt: + minValue, maxValue := pql.MinMax(0) + + min := col.Options.Min + if !min.EqualTo(minValue) { + fmt.Fprintf(&buf, " min %d", min.ToInt64(0)) + } + + max := col.Options.Max + if !max.EqualTo(maxValue) { + fmt.Fprintf(&buf, " max %d", max.ToInt64(0)) + } + + case *parser.DataTypeDecimal: + minValue, maxValue := pql.MinMax(dt.Scale) + + min := col.Options.Min + if !min.EqualTo(minValue) { + fmt.Fprintf(&buf, " min %v", min) + } + + max := col.Options.Max + if !max.EqualTo(maxValue) { + fmt.Fprintf(&buf, " max %v", max) + } + + case *parser.DataTypeTimestamp: + if len(col.Options.TimeUnit) > 0 { + fmt.Fprintf(&buf, " timeunit '%s'", col.Options.TimeUnit) + } + // TODO(pok) how do we get epoch out of col? + + } + } + buf.WriteString(");") + ddl := buf.String() + + i.result[idx] = &fbTableDDLRow{ + id: table.Name, + name: table.Name, + ddl: ddl, + } + } + } + + if len(i.result) > 0 { + n := i.result[0] + row := []interface{}{ + n.id, + n.name, + n.ddl, + } + // Move to next result element. + i.result = i.result[1:] + return row, nil + } + return nil, types.ErrNoMoreRows +} diff --git a/sql3/planner/optablevaluedfunction.go b/sql3/planner/optablevaluedfunction.go index 63660c0af..9f7ff23d0 100644 --- a/sql3/planner/optablevaluedfunction.go +++ b/sql3/planner/optablevaluedfunction.go @@ -59,7 +59,7 @@ func (p *PlanOpTableValuedFunction) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc diff --git a/sql3/planner/optop.go b/sql3/planner/optop.go index a87e0355a..a64b66bad 100644 --- a/sql3/planner/optop.go +++ b/sql3/planner/optop.go @@ -55,7 +55,7 @@ func (p *PlanOpTop) Plan() map[string]interface{} { result["_op"] = fmt.Sprintf("%T", p) sc := make([]string, 0) for _, e := range p.Schema() { - sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeName())) + sc = append(sc, fmt.Sprintf("'%s', '%s', '%s'", e.ColumnName, e.RelationName, e.Type.TypeDescription())) } result["_schema"] = sc diff --git a/sql3/sql_complex_test.go b/sql3/sql_complex_test.go index 3b12e6054..271858093 100644 --- a/sql3/sql_complex_test.go +++ b/sql3/sql_complex_test.go @@ -164,16 +164,42 @@ func TestPlanner_Show(t *testing.T) { if err != nil { t.Fatal(err) } - if len(results) != 5 { + if len(results) != 6 { t.Fatal(fmt.Errorf("unexpected result set length")) } if diff := cmp.Diff([]*pilosa.WireQueryField{ + wireQueryFieldString("_id"), wireQueryFieldString("name"), + wireQueryFieldString("owner"), + wireQueryFieldString("last_updated_user"), wireQueryFieldTimestamp("created_at"), wireQueryFieldBool("track_existence"), wireQueryFieldBool("keys"), wireQueryFieldInt("shard_width"), + wireQueryFieldString("description"), + }, columns); diff != "" { + t.Fatal(diff) + } + }) + + t.Run("ShowCreateTable", func(t *testing.T) { + results, columns, err := sql_test.MustQueryRows(t, c.GetNode(0).Server, fmt.Sprintf(`SHOW CREATE TABLE %i`, c)) + if err != nil { + t.Fatal(err) + } + if len(results) != 1 { + t.Fatal(fmt.Errorf("unexpected result set length: %d", len(results))) + } + + if diff := cmp.Diff([][]interface{}{ + {string("create table testplannershowi (_id id, f int min 0 max 1000, x int min 0 max 1000);")}, + }, results); diff != "" { + t.Fatal(diff) + } + + if diff := cmp.Diff([]*pilosa.WireQueryField{ + wireQueryFieldString("ddl"), }, columns); diff != "" { t.Fatal(diff) } @@ -189,6 +215,7 @@ func TestPlanner_Show(t *testing.T) { } if diff := cmp.Diff([]*pilosa.WireQueryField{ + wireQueryFieldString("_id"), wireQueryFieldString("name"), wireQueryFieldString("type"), wireQueryFieldString("internal_type"), @@ -218,6 +245,7 @@ func TestPlanner_Show(t *testing.T) { } if diff := cmp.Diff([]*pilosa.WireQueryField{ + wireQueryFieldString("_id"), wireQueryFieldString("name"), wireQueryFieldString("type"), wireQueryFieldString("internal_type"), @@ -598,6 +626,7 @@ func TestPlanner_CreateTable(t *testing.T) { t.Fatal(err) } if diff := cmp.Diff([]*pilosa.WireQueryField{ + wireQueryFieldString("_id"), wireQueryFieldString("name"), wireQueryFieldString("type"), wireQueryFieldString("internal_type"), @@ -1432,7 +1461,7 @@ func TestPlanner_BulkInsert(t *testing.T) { } _, _, err = sql_test.MustQueryRows(t, c.GetNode(0).Server, fmt.Sprintf(`bulk insert into j1 (_id, a, b) map (0 id, 1 int, 2 int) from '%s' WITH FORMAT 'CSV' INPUT 'FILE';`, tmpfile.Name())) - if err == nil || !strings.Contains(err.Error(), `value '_id' cannot be converted to type 'ID'`) { + if err == nil || !strings.Contains(err.Error(), `value '_id' cannot be converted to type 'id'`) { t.Fatalf("unexpected error: %v", err) } diff --git a/sql3/test/defs/defs_between.go b/sql3/test/defs/defs_between.go index bf6a87e7b..1b654c858 100644 --- a/sql3/test/defs/defs_between.go +++ b/sql3/test/defs/defs_between.go @@ -48,13 +48,13 @@ var betweenTests = TableTest{ SQLs: sqls( "select b1 between true and false from between_all_types", ), - ExpErr: "type 'BOOL' cannot be used as a range subscript", + ExpErr: "type 'bool' cannot be used as a range subscript", }, { SQLs: sqls( "select d1 between 1.23 and 4.56 from between_all_types", ), - ExpErr: "type 'DECIMAL(2)' cannot be used as a range subscript", + ExpErr: "type 'decimal(2)' cannot be used as a range subscript", }, { SQLs: sqls( @@ -72,19 +72,19 @@ var betweenTests = TableTest{ SQLs: sqls( "select ids1 between [100, 102] and [456, 789] from between_all_types", ), - ExpErr: "type 'IDSET' cannot be used as a range subscript", + ExpErr: "type 'idset' cannot be used as a range subscript", }, { SQLs: sqls( "select s1 between 'foo' and 'bar' from between_all_types", ), - ExpErr: "type 'STRING' cannot be used as a range subscript", + ExpErr: "type 'string' cannot be used as a range subscript", }, { SQLs: sqls( "select ss1 between ['a', 'b'] and ['c', 'd'] from between_all_types", ), - ExpErr: "type 'STRINGSET' cannot be used as a range subscript", + ExpErr: "type 'stringset' cannot be used as a range subscript", }, { SQLs: sqls( @@ -149,13 +149,13 @@ var notBetweenTests = TableTest{ SQLs: sqls( "select b1 not between true and false from not_between_all_types", ), - ExpErr: "type 'BOOL' cannot be used as a range subscript", + ExpErr: "type 'bool' cannot be used as a range subscript", }, { SQLs: sqls( "select d1 not between 1.23 and 4.56 from not_between_all_types", ), - ExpErr: "type 'DECIMAL(2)' cannot be used as a range subscript", + ExpErr: "type 'decimal(2)' cannot be used as a range subscript", }, { SQLs: sqls( @@ -173,19 +173,19 @@ var notBetweenTests = TableTest{ SQLs: sqls( "select ids1 not between [100, 102] and [456, 789] from not_between_all_types", ), - ExpErr: "type 'IDSET' cannot be used as a range subscript", + ExpErr: "type 'idset' cannot be used as a range subscript", }, { SQLs: sqls( "select s1 not between 'foo' and 'bar' from not_between_all_types", ), - ExpErr: "type 'STRING' cannot be used as a range subscript", + ExpErr: "type 'string' cannot be used as a range subscript", }, { SQLs: sqls( "select ss1 not between ['a', 'b'] and ['c', 'd'] from not_between_all_types", ), - ExpErr: "type 'STRINGSET' cannot be used as a range subscript", + ExpErr: "type 'stringset' cannot be used as a range subscript", }, { SQLs: sqls( diff --git a/sql3/test/defs/defs_binops.go b/sql3/test/defs/defs_binops.go index 15d04d44f..1650215de 100644 --- a/sql3/test/defs/defs_binops.go +++ b/sql3/test/defs/defs_binops.go @@ -204,7 +204,7 @@ var binOpExprWithIntInt = TableTest{ SQLs: sqls( "select a || b from binoptesti_i;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -226,97 +226,97 @@ var binOpExprWithIntBool = TableTest{ SQLs: sqls( "select a != b from binoptesti_b;", ), - ExpErr: "types 'INT' and 'BOOL' are not equatable", + ExpErr: "types 'int' and 'bool' are not equatable", }, { SQLs: sqls( "select a = b from binoptesti_b;", ), - ExpErr: "types 'INT' and 'BOOL' are not equatable", + ExpErr: "types 'int' and 'bool' are not equatable", }, { SQLs: sqls( "select a <= b from binoptesti_b;", ), - ExpErr: "operator '<=' incompatible with type 'BOOL'", + ExpErr: "operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select a >= b from binoptesti_b;", ), - ExpErr: "operator '>=' incompatible with type 'BOOL'", + ExpErr: "operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select a < b from binoptesti_b;", ), - ExpErr: "operator '<' incompatible with type 'BOOL'", + ExpErr: "operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select a > b from binoptesti_b;", ), - ExpErr: "operator '>' incompatible with type 'BOOL'", + ExpErr: "operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select a & b from binoptesti_b;", ), - ExpErr: "operator '&' incompatible with type 'BOOL'", + ExpErr: "operator '&' incompatible with type 'bool'", }, { SQLs: sqls( "select a | b from binoptesti_b;", ), - ExpErr: "operator '|' incompatible with type 'BOOL'", + ExpErr: "operator '|' incompatible with type 'bool'", }, { SQLs: sqls( "select a << b from binoptesti_b;", ), - ExpErr: "operator '<<' incompatible with type 'BOOL'", + ExpErr: "operator '<<' incompatible with type 'bool'", }, { SQLs: sqls( "select a >> b from binoptesti_b;", ), - ExpErr: "operator '>>' incompatible with type 'BOOL'", + ExpErr: "operator '>>' incompatible with type 'bool'", }, { SQLs: sqls( "select a + b from binoptesti_b;", ), - ExpErr: "operator '+' incompatible with type 'BOOL'", + ExpErr: "operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select a - b from binoptesti_b;", ), - ExpErr: "operator '-' incompatible with type 'BOOL'", + ExpErr: "operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select a * b from binoptesti_b;", ), - ExpErr: "operator '*' incompatible with type 'BOOL'", + ExpErr: "operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select a / b from binoptesti_b;", ), - ExpErr: "operator '/' incompatible with type 'BOOL'", + ExpErr: "operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select a % b from binoptesti_b;", ), - ExpErr: "operator '%' incompatible with type 'BOOL'", + ExpErr: "operator '%' incompatible with type 'bool'", }, { SQLs: sqls( "select a || b from binoptesti_b;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -517,7 +517,7 @@ var binOpExprWithIntID = TableTest{ SQLs: sqls( "select b || _id from binoptesti_id;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -611,25 +611,25 @@ var binOpExprWithIntDecimal = TableTest{ SQLs: sqls( "select a & d from binoptesti_d;", ), - ExpErr: "operator '&' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '&' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a | d from binoptesti_d;", ), - ExpErr: "operator '|' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '|' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a << d from binoptesti_d;", ), - ExpErr: "operator '<<' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '<<' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a >> d from binoptesti_d;", ), - ExpErr: "operator '>>' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '>>' incompatible with type 'decimal(2)'", }, { SQLs: sqls( @@ -683,13 +683,13 @@ var binOpExprWithIntDecimal = TableTest{ SQLs: sqls( "select a % d from binoptesti_d;", ), - ExpErr: "operator '%' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '%' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a || d from binoptesti_d;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -711,97 +711,97 @@ var binOpExprWithIntTimestamp = TableTest{ SQLs: sqls( "select a != ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a = ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a <= ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a >= ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a < ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a > ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a & ts from binoptesti_ts;", ), - ExpErr: "operator '&' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '&' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a | ts from binoptesti_ts;", ), - ExpErr: "operator '|' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '|' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a << ts from binoptesti_ts;", ), - ExpErr: "operator '<<' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '<<' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a >> ts from binoptesti_ts;", ), - ExpErr: "operator '>>' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '>>' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a + ts from binoptesti_ts;", ), - ExpErr: "operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a - ts from binoptesti_ts;", ), - ExpErr: "operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a * ts from binoptesti_ts;", ), - ExpErr: "operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a / ts from binoptesti_ts;", ), - ExpErr: "operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a % ts from binoptesti_ts;", ), - ExpErr: "operator '%' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '%' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a || ts from binoptesti_ts;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -823,97 +823,97 @@ var binOpExprWithIntIDSet = TableTest{ SQLs: sqls( "select a != b from binoptesti_ids;", ), - ExpErr: "types 'INT' and 'IDSET' are not equatable", + ExpErr: "types 'int' and 'idset' are not equatable", }, { SQLs: sqls( "select a = b from binoptesti_ids;", ), - ExpErr: "types 'INT' and 'IDSET' are not equatable", + ExpErr: "types 'int' and 'idset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptesti_ids;", ), - ExpErr: " operator '<=' incompatible with type 'IDSET'", + ExpErr: " operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select a >= b from binoptesti_ids;", ), - ExpErr: " operator '>=' incompatible with type 'IDSET'", + ExpErr: " operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select a < b from binoptesti_ids;", ), - ExpErr: " operator '<' incompatible with type 'IDSET'", + ExpErr: " operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select a > b from binoptesti_ids;", ), - ExpErr: " operator '>' incompatible with type 'IDSET'", + ExpErr: " operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select a & b from binoptesti_ids;", ), - ExpErr: " operator '&' incompatible with type 'IDSET'", + ExpErr: " operator '&' incompatible with type 'idset'", }, { SQLs: sqls( "select a | b from binoptesti_ids;", ), - ExpErr: " operator '|' incompatible with type 'IDSET'", + ExpErr: " operator '|' incompatible with type 'idset'", }, { SQLs: sqls( "select a << b from binoptesti_ids;", ), - ExpErr: " operator '<<' incompatible with type 'IDSET'", + ExpErr: " operator '<<' incompatible with type 'idset'", }, { SQLs: sqls( "select a >> b from binoptesti_ids;", ), - ExpErr: " operator '>>' incompatible with type 'IDSET'", + ExpErr: " operator '>>' incompatible with type 'idset'", }, { SQLs: sqls( "select a + b from binoptesti_ids;", ), - ExpErr: " operator '+' incompatible with type 'IDSET'", + ExpErr: " operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select a - b from binoptesti_ids;", ), - ExpErr: " operator '-' incompatible with type 'IDSET'", + ExpErr: " operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select a * b from binoptesti_ids;", ), - ExpErr: " operator '*' incompatible with type 'IDSET'", + ExpErr: " operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select a / b from binoptesti_ids;", ), - ExpErr: " operator '/' incompatible with type 'IDSET'", + ExpErr: " operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select a % b from binoptesti_ids;", ), - ExpErr: " operator '%' incompatible with type 'IDSET'", + ExpErr: " operator '%' incompatible with type 'idset'", }, { SQLs: sqls( "select a || b from binoptesti_ids;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -935,97 +935,97 @@ var binOpExprWithIntString = TableTest{ SQLs: sqls( "select a != b from binoptesti_s;", ), - ExpErr: "types 'INT' and 'STRING' are not equatable", + ExpErr: "types 'int' and 'string' are not equatable", }, { SQLs: sqls( "select a = b from binoptesti_s;", ), - ExpErr: "types 'INT' and 'STRING' are not equatable", + ExpErr: "types 'int' and 'string' are not equatable", }, { SQLs: sqls( "select a <= b from binoptesti_s;", ), - ExpErr: " operator '<=' incompatible with type 'STRING'", + ExpErr: " operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select a >= b from binoptesti_s;", ), - ExpErr: " operator '>=' incompatible with type 'STRING'", + ExpErr: " operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select a < b from binoptesti_s;", ), - ExpErr: " operator '<' incompatible with type 'STRING'", + ExpErr: " operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select a > b from binoptesti_s;", ), - ExpErr: " operator '>' incompatible with type 'STRING'", + ExpErr: " operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select a & b from binoptesti_s;", ), - ExpErr: " operator '&' incompatible with type 'STRING'", + ExpErr: " operator '&' incompatible with type 'string'", }, { SQLs: sqls( "select a | b from binoptesti_s;", ), - ExpErr: " operator '|' incompatible with type 'STRING'", + ExpErr: " operator '|' incompatible with type 'string'", }, { SQLs: sqls( "select a << b from binoptesti_s;", ), - ExpErr: " operator '<<' incompatible with type 'STRING'", + ExpErr: " operator '<<' incompatible with type 'string'", }, { SQLs: sqls( "select a >> b from binoptesti_s;", ), - ExpErr: " operator '>>' incompatible with type 'STRING'", + ExpErr: " operator '>>' incompatible with type 'string'", }, { SQLs: sqls( "select a + b from binoptesti_s;", ), - ExpErr: " operator '+' incompatible with type 'STRING'", + ExpErr: " operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select a - b from binoptesti_s;", ), - ExpErr: " operator '-' incompatible with type 'STRING'", + ExpErr: " operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select a * b from binoptesti_s;", ), - ExpErr: " operator '*' incompatible with type 'STRING'", + ExpErr: " operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select a / b from binoptesti_s;", ), - ExpErr: " operator '/' incompatible with type 'STRING'", + ExpErr: " operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select a % b from binoptesti_s;", ), - ExpErr: " operator '%' incompatible with type 'STRING'", + ExpErr: " operator '%' incompatible with type 'string'", }, { SQLs: sqls( "select a || b from binoptesti_s;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -1047,97 +1047,97 @@ var binOpExprWithIntStringSet = TableTest{ SQLs: sqls( "select a != b from binoptesti_ss;", ), - ExpErr: "types 'INT' and 'STRINGSET' are not equatable", + ExpErr: "types 'int' and 'stringset' are not equatable", }, { SQLs: sqls( "select a = b from binoptesti_ss;", ), - ExpErr: "types 'INT' and 'STRINGSET' are not equatable", + ExpErr: "types 'int' and 'stringset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptesti_ss;", ), - ExpErr: " operator '<=' incompatible with type 'STRINGSET'", + ExpErr: " operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >= b from binoptesti_ss;", ), - ExpErr: " operator '>=' incompatible with type 'STRINGSET'", + ExpErr: " operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a < b from binoptesti_ss;", ), - ExpErr: " operator '<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a > b from binoptesti_ss;", ), - ExpErr: " operator '>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a & b from binoptesti_ss;", ), - ExpErr: " operator '&' incompatible with type 'STRINGSET'", + ExpErr: " operator '&' incompatible with type 'stringset'", }, { SQLs: sqls( "select a | b from binoptesti_ss;", ), - ExpErr: " operator '|' incompatible with type 'STRINGSET'", + ExpErr: " operator '|' incompatible with type 'stringset'", }, { SQLs: sqls( "select a << b from binoptesti_ss;", ), - ExpErr: " operator '<<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >> b from binoptesti_ss;", ), - ExpErr: " operator '>>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a + b from binoptesti_ss;", ), - ExpErr: " operator '+' incompatible with type 'STRINGSET'", + ExpErr: " operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select a - b from binoptesti_ss;", ), - ExpErr: " operator '-' incompatible with type 'STRINGSET'", + ExpErr: " operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select a * b from binoptesti_ss;", ), - ExpErr: " operator '*' incompatible with type 'STRINGSET'", + ExpErr: " operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select a / b from binoptesti_ss;", ), - ExpErr: " operator '/' incompatible with type 'STRINGSET'", + ExpErr: " operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select a % b from binoptesti_ss;", ), - ExpErr: " operator '%' incompatible with type 'STRINGSET'", + ExpErr: " operator '%' incompatible with type 'stringset'", }, { SQLs: sqls( "select a || b from binoptesti_ss;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -1160,97 +1160,97 @@ var binOpExprWithBoolInt = TableTest{ SQLs: sqls( "select a != b from binoptestb_i;", ), - ExpErr: "types 'BOOL' and 'INT' are not equatable", + ExpErr: "types 'bool' and 'int' are not equatable", }, { SQLs: sqls( "select a = b from binoptestb_i;", ), - ExpErr: "types 'BOOL' and 'INT' are not equatable", + ExpErr: "types 'bool' and 'int' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestb_i;", ), - ExpErr: "operator '<=' incompatible with type 'BOOL'", + ExpErr: "operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select a >= b from binoptestb_i;", ), - ExpErr: "operator '>=' incompatible with type 'BOOL'", + ExpErr: "operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select a < b from binoptestb_i;", ), - ExpErr: "operator '<' incompatible with type 'BOOL'", + ExpErr: "operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select a > b from binoptestb_i;", ), - ExpErr: "operator '>' incompatible with type 'BOOL'", + ExpErr: "operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select a & b from binoptestb_i;", ), - ExpErr: "operator '&' incompatible with type 'BOOL'", + ExpErr: "operator '&' incompatible with type 'bool'", }, { SQLs: sqls( "select a | b from binoptestb_i;", ), - ExpErr: "operator '|' incompatible with type 'BOOL'", + ExpErr: "operator '|' incompatible with type 'bool'", }, { SQLs: sqls( "select a << b from binoptestb_i;", ), - ExpErr: "operator '<<' incompatible with type 'BOOL'", + ExpErr: "operator '<<' incompatible with type 'bool'", }, { SQLs: sqls( "select a >> b from binoptestb_i;", ), - ExpErr: "operator '>>' incompatible with type 'BOOL'", + ExpErr: "operator '>>' incompatible with type 'bool'", }, { SQLs: sqls( "select a + b from binoptestb_i;", ), - ExpErr: "operator '+' incompatible with type 'BOOL'", + ExpErr: "operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select a - b from binoptestb_i;", ), - ExpErr: "operator '-' incompatible with type 'BOOL'", + ExpErr: "operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select a * b from binoptestb_i;", ), - ExpErr: "operator '*' incompatible with type 'BOOL'", + ExpErr: "operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select a / b from binoptestb_i;", ), - ExpErr: "operator '/' incompatible with type 'BOOL'", + ExpErr: "operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select a % b from binoptestb_i;", ), - ExpErr: "operator '%' incompatible with type 'BOOL'", + ExpErr: "operator '%' incompatible with type 'bool'", }, { SQLs: sqls( "select a || b from binoptestb_i;", ), - ExpErr: "operator '||' incompatible with type 'BOOL'", + ExpErr: "operator '||' incompatible with type 'bool'", }, }, } @@ -1296,85 +1296,85 @@ var binOpExprWithBoolBool = TableTest{ SQLs: sqls( "select a <= b from binoptestb_b;", ), - ExpErr: "operator '<=' incompatible with type 'BOOL'", + ExpErr: "operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select a >= b from binoptestb_b;", ), - ExpErr: "operator '>=' incompatible with type 'BOOL'", + ExpErr: "operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select a < b from binoptestb_b;", ), - ExpErr: "operator '<' incompatible with type 'BOOL'", + ExpErr: "operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select a > b from binoptestb_b;", ), - ExpErr: "operator '>' incompatible with type 'BOOL'", + ExpErr: "operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select a & b from binoptestb_b;", ), - ExpErr: "operator '&' incompatible with type 'BOOL'", + ExpErr: "operator '&' incompatible with type 'bool'", }, { SQLs: sqls( "select a | b from binoptestb_b;", ), - ExpErr: "operator '|' incompatible with type 'BOOL'", + ExpErr: "operator '|' incompatible with type 'bool'", }, { SQLs: sqls( "select a << b from binoptestb_b;", ), - ExpErr: "operator '<<' incompatible with type 'BOOL'", + ExpErr: "operator '<<' incompatible with type 'bool'", }, { SQLs: sqls( "select a >> b from binoptestb_b;", ), - ExpErr: "operator '>>' incompatible with type 'BOOL'", + ExpErr: "operator '>>' incompatible with type 'bool'", }, { SQLs: sqls( "select a + b from binoptestb_b;", ), - ExpErr: "operator '+' incompatible with type 'BOOL'", + ExpErr: "operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select a - b from binoptestb_b;", ), - ExpErr: "operator '-' incompatible with type 'BOOL'", + ExpErr: "operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select a * b from binoptestb_b;", ), - ExpErr: "operator '*' incompatible with type 'BOOL'", + ExpErr: "operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select a / b from binoptestb_b;", ), - ExpErr: "operator '/' incompatible with type 'BOOL'", + ExpErr: "operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select a % b from binoptestb_b;", ), - ExpErr: "operator '%' incompatible with type 'BOOL'", + ExpErr: "operator '%' incompatible with type 'bool'", }, { SQLs: sqls( "select a || b from binoptestb_b;", ), - ExpErr: "operator '||' incompatible with type 'BOOL'", + ExpErr: "operator '||' incompatible with type 'bool'", }, }, } @@ -1395,97 +1395,97 @@ var binOpExprWithBoolID = TableTest{ SQLs: sqls( "select b != _id from binoptestb_id;", ), - ExpErr: "types 'BOOL' and 'ID' are not equatable", + ExpErr: "types 'bool' and 'id' are not equatable", }, { SQLs: sqls( "select b = _id from binoptestb_id;", ), - ExpErr: "types 'BOOL' and 'ID' are not equatable", + ExpErr: "types 'bool' and 'id' are not equatable", }, { SQLs: sqls( "select b <= _id from binoptestb_id;", ), - ExpErr: "operator '<=' incompatible with type 'BOOL'", + ExpErr: "operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select b >= _id from binoptestb_id;", ), - ExpErr: "operator '>=' incompatible with type 'BOOL'", + ExpErr: "operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select b < _id from binoptestb_id;", ), - ExpErr: "operator '<' incompatible with type 'BOOL'", + ExpErr: "operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select b > _id from binoptestb_id;", ), - ExpErr: "operator '>' incompatible with type 'BOOL'", + ExpErr: "operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select b & _id from binoptestb_id;", ), - ExpErr: "operator '&' incompatible with type 'BOOL'", + ExpErr: "operator '&' incompatible with type 'bool'", }, { SQLs: sqls( "select b | _id from binoptestb_id;", ), - ExpErr: "operator '|' incompatible with type 'BOOL'", + ExpErr: "operator '|' incompatible with type 'bool'", }, { SQLs: sqls( "select b << _id from binoptestb_id;", ), - ExpErr: "operator '<<' incompatible with type 'BOOL'", + ExpErr: "operator '<<' incompatible with type 'bool'", }, { SQLs: sqls( "select b >> _id from binoptestb_id;", ), - ExpErr: "operator '>>' incompatible with type 'BOOL'", + ExpErr: "operator '>>' incompatible with type 'bool'", }, { SQLs: sqls( "select b + _id from binoptestb_id;", ), - ExpErr: "operator '+' incompatible with type 'BOOL'", + ExpErr: "operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select b - _id from binoptestb_id;", ), - ExpErr: "operator '-' incompatible with type 'BOOL'", + ExpErr: "operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select b * _id from binoptestb_id;", ), - ExpErr: "operator '*' incompatible with type 'BOOL'", + ExpErr: "operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select b / _id from binoptestb_id;", ), - ExpErr: "operator '/' incompatible with type 'BOOL'", + ExpErr: "operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select b % _id from binoptestb_id;", ), - ExpErr: "operator '%' incompatible with type 'BOOL'", + ExpErr: "operator '%' incompatible with type 'bool'", }, { SQLs: sqls( "select b || _id from binoptestb_id;", ), - ExpErr: "operator '||' incompatible with type 'BOOL'", + ExpErr: "operator '||' incompatible with type 'bool'", }, }, } @@ -1507,97 +1507,97 @@ var binOpExprWithBoolDecimal = TableTest{ SQLs: sqls( "select a != d from binoptestb_d;", ), - ExpErr: "types 'BOOL' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'bool' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a = d from binoptestb_d;", ), - ExpErr: "types 'BOOL' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'bool' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a <= d from binoptestb_d;", ), - ExpErr: "operator '<=' incompatible with type 'BOOL'", + ExpErr: "operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select a >= d from binoptestb_d;", ), - ExpErr: "operator '>=' incompatible with type 'BOOL'", + ExpErr: "operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select a < d from binoptestb_d;", ), - ExpErr: "operator '<' incompatible with type 'BOOL'", + ExpErr: "operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select a > d from binoptestb_d;", ), - ExpErr: "operator '>' incompatible with type 'BOOL'", + ExpErr: "operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select a & d from binoptestb_d;", ), - ExpErr: "operator '&' incompatible with type 'BOOL'", + ExpErr: "operator '&' incompatible with type 'bool'", }, { SQLs: sqls( "select a | d from binoptestb_d;", ), - ExpErr: "operator '|' incompatible with type 'BOOL'", + ExpErr: "operator '|' incompatible with type 'bool'", }, { SQLs: sqls( "select a << d from binoptestb_d;", ), - ExpErr: "operator '<<' incompatible with type 'BOOL'", + ExpErr: "operator '<<' incompatible with type 'bool'", }, { SQLs: sqls( "select a >> d from binoptestb_d;", ), - ExpErr: "operator '>>' incompatible with type 'BOOL'", + ExpErr: "operator '>>' incompatible with type 'bool'", }, { SQLs: sqls( "select a + d from binoptestb_d;", ), - ExpErr: "operator '+' incompatible with type 'BOOL'", + ExpErr: "operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select a - d from binoptestb_d;", ), - ExpErr: "operator '-' incompatible with type 'BOOL'", + ExpErr: "operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select a * d from binoptestb_d;", ), - ExpErr: "operator '*' incompatible with type 'BOOL'", + ExpErr: "operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select a / d from binoptestb_d;", ), - ExpErr: "operator '/' incompatible with type 'BOOL'", + ExpErr: "operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select a % d from binoptestb_d;", ), - ExpErr: "operator '%' incompatible with type 'BOOL'", + ExpErr: "operator '%' incompatible with type 'bool'", }, { SQLs: sqls( "select a || d from binoptestb_d;", ), - ExpErr: "operator '||' incompatible with type 'BOOL'", + ExpErr: "operator '||' incompatible with type 'bool'", }, }, } @@ -1619,97 +1619,97 @@ var binOpExprWithBoolTimestamp = TableTest{ SQLs: sqls( "select a != ts from binoptestb_ts;", ), - ExpErr: "types 'BOOL' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'bool' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a = ts from binoptestb_ts;", ), - ExpErr: "types 'BOOL' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'bool' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a <= ts from binoptestb_ts;", ), - ExpErr: "operator '<=' incompatible with type 'BOOL'", + ExpErr: "operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select a >= ts from binoptestb_ts;", ), - ExpErr: "operator '>=' incompatible with type 'BOOL'", + ExpErr: "operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select a < ts from binoptestb_ts;", ), - ExpErr: "operator '<' incompatible with type 'BOOL'", + ExpErr: "operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select a > ts from binoptestb_ts;", ), - ExpErr: "operator '>' incompatible with type 'BOOL'", + ExpErr: "operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select a & ts from binoptestb_ts;", ), - ExpErr: "operator '&' incompatible with type 'BOOL'", + ExpErr: "operator '&' incompatible with type 'bool'", }, { SQLs: sqls( "select a | ts from binoptestb_ts;", ), - ExpErr: "operator '|' incompatible with type 'BOOL'", + ExpErr: "operator '|' incompatible with type 'bool'", }, { SQLs: sqls( "select a << ts from binoptestb_ts;", ), - ExpErr: "operator '<<' incompatible with type 'BOOL'", + ExpErr: "operator '<<' incompatible with type 'bool'", }, { SQLs: sqls( "select a >> ts from binoptestb_ts;", ), - ExpErr: "operator '>>' incompatible with type 'BOOL'", + ExpErr: "operator '>>' incompatible with type 'bool'", }, { SQLs: sqls( "select a + ts from binoptestb_ts;", ), - ExpErr: "operator '+' incompatible with type 'BOOL'", + ExpErr: "operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select a - ts from binoptestb_ts;", ), - ExpErr: "operator '-' incompatible with type 'BOOL'", + ExpErr: "operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select a * ts from binoptestb_ts;", ), - ExpErr: "operator '*' incompatible with type 'BOOL'", + ExpErr: "operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select a / ts from binoptestb_ts;", ), - ExpErr: "operator '/' incompatible with type 'BOOL'", + ExpErr: "operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select a % ts from binoptestb_ts;", ), - ExpErr: "operator '%' incompatible with type 'BOOL'", + ExpErr: "operator '%' incompatible with type 'bool'", }, { SQLs: sqls( "select a || ts from binoptestb_ts;", ), - ExpErr: "operator '||' incompatible with type 'BOOL'", + ExpErr: "operator '||' incompatible with type 'bool'", }, }, } @@ -1731,97 +1731,97 @@ var binOpExprWithBoolIDSet = TableTest{ SQLs: sqls( "select a != b from binoptestb_ids;", ), - ExpErr: "types 'BOOL' and 'IDSET' are not equatable", + ExpErr: "types 'bool' and 'idset' are not equatable", }, { SQLs: sqls( "select a = b from binoptestb_ids;", ), - ExpErr: "types 'BOOL' and 'IDSET' are not equatable", + ExpErr: "types 'bool' and 'idset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestb_ids;", ), - ExpErr: " operator '<=' incompatible with type 'BOOL'", + ExpErr: " operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select a >= b from binoptestb_ids;", ), - ExpErr: " operator '>=' incompatible with type 'BOOL'", + ExpErr: " operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select a < b from binoptestb_ids;", ), - ExpErr: " operator '<' incompatible with type 'BOOL'", + ExpErr: " operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select a > b from binoptestb_ids;", ), - ExpErr: " operator '>' incompatible with type 'BOOL'", + ExpErr: " operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select a & b from binoptestb_ids;", ), - ExpErr: " operator '&' incompatible with type 'BOOL'", + ExpErr: " operator '&' incompatible with type 'bool'", }, { SQLs: sqls( "select a | b from binoptestb_ids;", ), - ExpErr: " operator '|' incompatible with type 'BOOL'", + ExpErr: " operator '|' incompatible with type 'bool'", }, { SQLs: sqls( "select a << b from binoptestb_ids;", ), - ExpErr: " operator '<<' incompatible with type 'BOOL'", + ExpErr: " operator '<<' incompatible with type 'bool'", }, { SQLs: sqls( "select a >> b from binoptestb_ids;", ), - ExpErr: " operator '>>' incompatible with type 'BOOL'", + ExpErr: " operator '>>' incompatible with type 'bool'", }, { SQLs: sqls( "select a + b from binoptestb_ids;", ), - ExpErr: " operator '+' incompatible with type 'BOOL'", + ExpErr: " operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select a - b from binoptestb_ids;", ), - ExpErr: " operator '-' incompatible with type 'BOOL'", + ExpErr: " operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select a * b from binoptestb_ids;", ), - ExpErr: " operator '*' incompatible with type 'BOOL'", + ExpErr: " operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select a / b from binoptestb_ids;", ), - ExpErr: " operator '/' incompatible with type 'BOOL'", + ExpErr: " operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select a % b from binoptestb_ids;", ), - ExpErr: " operator '%' incompatible with type 'BOOL'", + ExpErr: " operator '%' incompatible with type 'bool'", }, { SQLs: sqls( "select a || b from binoptestb_ids;", ), - ExpErr: "operator '||' incompatible with type 'BOOL'", + ExpErr: "operator '||' incompatible with type 'bool'", }, }, } @@ -1843,97 +1843,97 @@ var binOpExprWithBoolString = TableTest{ SQLs: sqls( "select a != b from binoptestb_s;", ), - ExpErr: "types 'BOOL' and 'STRING' are not equatable", + ExpErr: "types 'bool' and 'string' are not equatable", }, { SQLs: sqls( "select a = b from binoptestb_s;", ), - ExpErr: "types 'BOOL' and 'STRING' are not equatable", + ExpErr: "types 'bool' and 'string' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestb_s;", ), - ExpErr: " operator '<=' incompatible with type 'BOOL'", + ExpErr: " operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select a >= b from binoptestb_s;", ), - ExpErr: " operator '>=' incompatible with type 'BOOL'", + ExpErr: " operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select a < b from binoptestb_s;", ), - ExpErr: " operator '<' incompatible with type 'BOOL'", + ExpErr: " operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select a > b from binoptestb_s;", ), - ExpErr: " operator '>' incompatible with type 'BOOL'", + ExpErr: " operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select a & b from binoptestb_s;", ), - ExpErr: " operator '&' incompatible with type 'BOOL'", + ExpErr: " operator '&' incompatible with type 'bool'", }, { SQLs: sqls( "select a | b from binoptestb_s;", ), - ExpErr: " operator '|' incompatible with type 'BOOL'", + ExpErr: " operator '|' incompatible with type 'bool'", }, { SQLs: sqls( "select a << b from binoptestb_s;", ), - ExpErr: " operator '<<' incompatible with type 'BOOL'", + ExpErr: " operator '<<' incompatible with type 'bool'", }, { SQLs: sqls( "select a >> b from binoptestb_s;", ), - ExpErr: " operator '>>' incompatible with type 'BOOL'", + ExpErr: " operator '>>' incompatible with type 'bool'", }, { SQLs: sqls( "select a + b from binoptestb_s;", ), - ExpErr: " operator '+' incompatible with type 'BOOL'", + ExpErr: " operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select a - b from binoptestb_s;", ), - ExpErr: " operator '-' incompatible with type 'BOOL'", + ExpErr: " operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select a * b from binoptestb_s;", ), - ExpErr: " operator '*' incompatible with type 'BOOL'", + ExpErr: " operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select a / b from binoptestb_s;", ), - ExpErr: " operator '/' incompatible with type 'BOOL'", + ExpErr: " operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select a % b from binoptestb_s;", ), - ExpErr: " operator '%' incompatible with type 'BOOL'", + ExpErr: " operator '%' incompatible with type 'bool'", }, { SQLs: sqls( "select a || b from binoptestb_s;", ), - ExpErr: "operator '||' incompatible with type 'BOOL'", + ExpErr: "operator '||' incompatible with type 'bool'", }, }, } @@ -1955,97 +1955,97 @@ var binOpExprWithBoolStringSet = TableTest{ SQLs: sqls( "select a != b from binoptestb_ss;", ), - ExpErr: "types 'BOOL' and 'STRINGSET' are not equatable", + ExpErr: "types 'bool' and 'stringset' are not equatable", }, { SQLs: sqls( "select a = b from binoptestb_ss;", ), - ExpErr: "types 'BOOL' and 'STRINGSET' are not equatable", + ExpErr: "types 'bool' and 'stringset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestb_ss;", ), - ExpErr: " operator '<=' incompatible with type 'BOOL'", + ExpErr: " operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select a >= b from binoptestb_ss;", ), - ExpErr: " operator '>=' incompatible with type 'BOOL'", + ExpErr: " operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select a < b from binoptestb_ss;", ), - ExpErr: " operator '<' incompatible with type 'BOOL'", + ExpErr: " operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select a > b from binoptestb_ss;", ), - ExpErr: " operator '>' incompatible with type 'BOOL'", + ExpErr: " operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select a & b from binoptestb_ss;", ), - ExpErr: " operator '&' incompatible with type 'BOOL'", + ExpErr: " operator '&' incompatible with type 'bool'", }, { SQLs: sqls( "select a | b from binoptestb_ss;", ), - ExpErr: " operator '|' incompatible with type 'BOOL'", + ExpErr: " operator '|' incompatible with type 'bool'", }, { SQLs: sqls( "select a << b from binoptestb_ss;", ), - ExpErr: " operator '<<' incompatible with type 'BOOL'", + ExpErr: " operator '<<' incompatible with type 'bool'", }, { SQLs: sqls( "select a >> b from binoptestb_ss;", ), - ExpErr: " operator '>>' incompatible with type 'BOOL'", + ExpErr: " operator '>>' incompatible with type 'bool'", }, { SQLs: sqls( "select a + b from binoptestb_ss;", ), - ExpErr: " operator '+' incompatible with type 'BOOL'", + ExpErr: " operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select a - b from binoptestb_ss;", ), - ExpErr: " operator '-' incompatible with type 'BOOL'", + ExpErr: " operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select a * b from binoptestb_ss;", ), - ExpErr: " operator '*' incompatible with type 'BOOL'", + ExpErr: " operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select a / b from binoptestb_ss;", ), - ExpErr: " operator '/' incompatible with type 'BOOL'", + ExpErr: " operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select a % b from binoptestb_ss;", ), - ExpErr: " operator '%' incompatible with type 'BOOL'", + ExpErr: " operator '%' incompatible with type 'bool'", }, { SQLs: sqls( "select a || b from binoptestb_ss;", ), - ExpErr: "operator '||' incompatible with type 'BOOL'", + ExpErr: "operator '||' incompatible with type 'bool'", }, }, } @@ -2247,7 +2247,7 @@ var binOpExprWithIDInt = TableTest{ SQLs: sqls( "select _id || b from binoptestid_i;", ), - ExpErr: "operator '||' incompatible with type 'ID'", + ExpErr: "operator '||' incompatible with type 'id'", }, }, } @@ -2268,97 +2268,97 @@ var binOpExprWithIDBool = TableTest{ SQLs: sqls( "select _id != b from binoptestid_b;", ), - ExpErr: "types 'ID' and 'BOOL' are not equatable", + ExpErr: "types 'id' and 'bool' are not equatable", }, { SQLs: sqls( "select _id = b from binoptestid_b;", ), - ExpErr: "types 'ID' and 'BOOL' are not equatable", + ExpErr: "types 'id' and 'bool' are not equatable", }, { SQLs: sqls( "select _id <= b from binoptestid_b;", ), - ExpErr: "operator '<=' incompatible with type 'BOOL'", + ExpErr: "operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select _id >= b from binoptestid_b;", ), - ExpErr: "operator '>=' incompatible with type 'BOOL'", + ExpErr: "operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select _id < b from binoptestid_b;", ), - ExpErr: "operator '<' incompatible with type 'BOOL'", + ExpErr: "operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select _id > b from binoptestid_b;", ), - ExpErr: "operator '>' incompatible with type 'BOOL'", + ExpErr: "operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select _id & b from binoptestid_b;", ), - ExpErr: "operator '&' incompatible with type 'BOOL'", + ExpErr: "operator '&' incompatible with type 'bool'", }, { SQLs: sqls( "select _id | b from binoptestid_b;", ), - ExpErr: "operator '|' incompatible with type 'BOOL'", + ExpErr: "operator '|' incompatible with type 'bool'", }, { SQLs: sqls( "select _id << b from binoptestid_b;", ), - ExpErr: "operator '<<' incompatible with type 'BOOL'", + ExpErr: "operator '<<' incompatible with type 'bool'", }, { SQLs: sqls( "select _id >> b from binoptestid_b;", ), - ExpErr: "operator '>>' incompatible with type 'BOOL'", + ExpErr: "operator '>>' incompatible with type 'bool'", }, { SQLs: sqls( "select _id + b from binoptestid_b;", ), - ExpErr: "operator '+' incompatible with type 'BOOL'", + ExpErr: "operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select _id - b from binoptestid_b;", ), - ExpErr: "operator '-' incompatible with type 'BOOL'", + ExpErr: "operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select _id * b from binoptestid_b;", ), - ExpErr: "operator '*' incompatible with type 'BOOL'", + ExpErr: "operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select _id / b from binoptestid_b;", ), - ExpErr: "operator '/' incompatible with type 'BOOL'", + ExpErr: "operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select _id % b from binoptestid_b;", ), - ExpErr: "operator '%' incompatible with type 'BOOL'", + ExpErr: "operator '%' incompatible with type 'bool'", }, { SQLs: sqls( "select _id || b from binoptestid_b;", ), - ExpErr: "operator '||' incompatible with type 'ID'", + ExpErr: "operator '||' incompatible with type 'id'", }, }, } @@ -2559,7 +2559,7 @@ var binOpExprWithIDID = TableTest{ SQLs: sqls( "select _id || b from binoptestid_id;", ), - ExpErr: "operator '||' incompatible with type 'ID'", + ExpErr: "operator '||' incompatible with type 'id'", }, }, } @@ -2653,25 +2653,25 @@ var binOpExprWithIDDecimal = TableTest{ SQLs: sqls( "select a & d from binoptesti_d;", ), - ExpErr: "operator '&' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '&' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a | d from binoptesti_d;", ), - ExpErr: "operator '|' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '|' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a << d from binoptesti_d;", ), - ExpErr: "operator '<<' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '<<' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a >> d from binoptesti_d;", ), - ExpErr: "operator '>>' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '>>' incompatible with type 'decimal(2)'", }, { SQLs: sqls( @@ -2725,13 +2725,13 @@ var binOpExprWithIDDecimal = TableTest{ SQLs: sqls( "select a % d from binoptesti_d;", ), - ExpErr: "operator '%' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '%' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a || d from binoptesti_d;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -2753,97 +2753,97 @@ var binOpExprWithIDTimestamp = TableTest{ SQLs: sqls( "select a != ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a = ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a <= ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a >= ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a < ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a > ts from binoptesti_ts;", ), - ExpErr: "types 'INT' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'int' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a & ts from binoptesti_ts;", ), - ExpErr: "operator '&' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '&' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a | ts from binoptesti_ts;", ), - ExpErr: "operator '|' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '|' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a << ts from binoptesti_ts;", ), - ExpErr: "operator '<<' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '<<' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a >> ts from binoptesti_ts;", ), - ExpErr: "operator '>>' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '>>' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a + ts from binoptesti_ts;", ), - ExpErr: "operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a - ts from binoptesti_ts;", ), - ExpErr: "operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a * ts from binoptesti_ts;", ), - ExpErr: "operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a / ts from binoptesti_ts;", ), - ExpErr: "operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a % ts from binoptesti_ts;", ), - ExpErr: "operator '%' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '%' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a || ts from binoptesti_ts;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -2865,97 +2865,97 @@ var binOpExprWithIDIDSet = TableTest{ SQLs: sqls( "select a != b from binoptesti_ids;", ), - ExpErr: "types 'INT' and 'IDSET' are not equatable", + ExpErr: "types 'int' and 'idset' are not equatable", }, { SQLs: sqls( "select a = b from binoptesti_ids;", ), - ExpErr: "types 'INT' and 'IDSET' are not equatable", + ExpErr: "types 'int' and 'idset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptesti_ids;", ), - ExpErr: " operator '<=' incompatible with type 'IDSET'", + ExpErr: " operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select a >= b from binoptesti_ids;", ), - ExpErr: " operator '>=' incompatible with type 'IDSET'", + ExpErr: " operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select a < b from binoptesti_ids;", ), - ExpErr: " operator '<' incompatible with type 'IDSET'", + ExpErr: " operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select a > b from binoptesti_ids;", ), - ExpErr: " operator '>' incompatible with type 'IDSET'", + ExpErr: " operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select a & b from binoptesti_ids;", ), - ExpErr: " operator '&' incompatible with type 'IDSET'", + ExpErr: " operator '&' incompatible with type 'idset'", }, { SQLs: sqls( "select a | b from binoptesti_ids;", ), - ExpErr: " operator '|' incompatible with type 'IDSET'", + ExpErr: " operator '|' incompatible with type 'idset'", }, { SQLs: sqls( "select a << b from binoptesti_ids;", ), - ExpErr: " operator '<<' incompatible with type 'IDSET'", + ExpErr: " operator '<<' incompatible with type 'idset'", }, { SQLs: sqls( "select a >> b from binoptesti_ids;", ), - ExpErr: " operator '>>' incompatible with type 'IDSET'", + ExpErr: " operator '>>' incompatible with type 'idset'", }, { SQLs: sqls( "select a + b from binoptesti_ids;", ), - ExpErr: " operator '+' incompatible with type 'IDSET'", + ExpErr: " operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select a - b from binoptesti_ids;", ), - ExpErr: " operator '-' incompatible with type 'IDSET'", + ExpErr: " operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select a * b from binoptesti_ids;", ), - ExpErr: " operator '*' incompatible with type 'IDSET'", + ExpErr: " operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select a / b from binoptesti_ids;", ), - ExpErr: " operator '/' incompatible with type 'IDSET'", + ExpErr: " operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select a % b from binoptesti_ids;", ), - ExpErr: " operator '%' incompatible with type 'IDSET'", + ExpErr: " operator '%' incompatible with type 'idset'", }, { SQLs: sqls( "select a || b from binoptesti_ids;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -2977,97 +2977,97 @@ var binOpExprWithIDString = TableTest{ SQLs: sqls( "select a != b from binoptesti_s;", ), - ExpErr: "types 'INT' and 'STRING' are not equatable", + ExpErr: "types 'int' and 'string' are not equatable", }, { SQLs: sqls( "select a = b from binoptesti_s;", ), - ExpErr: "types 'INT' and 'STRING' are not equatable", + ExpErr: "types 'int' and 'string' are not equatable", }, { SQLs: sqls( "select a <= b from binoptesti_s;", ), - ExpErr: " operator '<=' incompatible with type 'STRING'", + ExpErr: " operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select a >= b from binoptesti_s;", ), - ExpErr: " operator '>=' incompatible with type 'STRING'", + ExpErr: " operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select a < b from binoptesti_s;", ), - ExpErr: " operator '<' incompatible with type 'STRING'", + ExpErr: " operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select a > b from binoptesti_s;", ), - ExpErr: " operator '>' incompatible with type 'STRING'", + ExpErr: " operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select a & b from binoptesti_s;", ), - ExpErr: " operator '&' incompatible with type 'STRING'", + ExpErr: " operator '&' incompatible with type 'string'", }, { SQLs: sqls( "select a | b from binoptesti_s;", ), - ExpErr: " operator '|' incompatible with type 'STRING'", + ExpErr: " operator '|' incompatible with type 'string'", }, { SQLs: sqls( "select a << b from binoptesti_s;", ), - ExpErr: " operator '<<' incompatible with type 'STRING'", + ExpErr: " operator '<<' incompatible with type 'string'", }, { SQLs: sqls( "select a >> b from binoptesti_s;", ), - ExpErr: " operator '>>' incompatible with type 'STRING'", + ExpErr: " operator '>>' incompatible with type 'string'", }, { SQLs: sqls( "select a + b from binoptesti_s;", ), - ExpErr: " operator '+' incompatible with type 'STRING'", + ExpErr: " operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select a - b from binoptesti_s;", ), - ExpErr: " operator '-' incompatible with type 'STRING'", + ExpErr: " operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select a * b from binoptesti_s;", ), - ExpErr: " operator '*' incompatible with type 'STRING'", + ExpErr: " operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select a / b from binoptesti_s;", ), - ExpErr: " operator '/' incompatible with type 'STRING'", + ExpErr: " operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select a % b from binoptesti_s;", ), - ExpErr: " operator '%' incompatible with type 'STRING'", + ExpErr: " operator '%' incompatible with type 'string'", }, { SQLs: sqls( "select a || b from binoptesti_s;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -3089,97 +3089,97 @@ var binOpExprWithIDStringSet = TableTest{ SQLs: sqls( "select a != b from binoptesti_ss;", ), - ExpErr: "types 'INT' and 'STRINGSET' are not equatable", + ExpErr: "types 'int' and 'stringset' are not equatable", }, { SQLs: sqls( "select a = b from binoptesti_ss;", ), - ExpErr: "types 'INT' and 'STRINGSET' are not equatable", + ExpErr: "types 'int' and 'stringset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptesti_ss;", ), - ExpErr: " operator '<=' incompatible with type 'STRINGSET'", + ExpErr: " operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >= b from binoptesti_ss;", ), - ExpErr: " operator '>=' incompatible with type 'STRINGSET'", + ExpErr: " operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a < b from binoptesti_ss;", ), - ExpErr: " operator '<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a > b from binoptesti_ss;", ), - ExpErr: " operator '>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a & b from binoptesti_ss;", ), - ExpErr: " operator '&' incompatible with type 'STRINGSET'", + ExpErr: " operator '&' incompatible with type 'stringset'", }, { SQLs: sqls( "select a | b from binoptesti_ss;", ), - ExpErr: " operator '|' incompatible with type 'STRINGSET'", + ExpErr: " operator '|' incompatible with type 'stringset'", }, { SQLs: sqls( "select a << b from binoptesti_ss;", ), - ExpErr: " operator '<<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >> b from binoptesti_ss;", ), - ExpErr: " operator '>>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a + b from binoptesti_ss;", ), - ExpErr: " operator '+' incompatible with type 'STRINGSET'", + ExpErr: " operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select a - b from binoptesti_ss;", ), - ExpErr: " operator '-' incompatible with type 'STRINGSET'", + ExpErr: " operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select a * b from binoptesti_ss;", ), - ExpErr: " operator '*' incompatible with type 'STRINGSET'", + ExpErr: " operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select a / b from binoptesti_ss;", ), - ExpErr: " operator '/' incompatible with type 'STRINGSET'", + ExpErr: " operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select a % b from binoptesti_ss;", ), - ExpErr: " operator '%' incompatible with type 'STRINGSET'", + ExpErr: " operator '%' incompatible with type 'stringset'", }, { SQLs: sqls( "select a || b from binoptesti_ss;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -3274,25 +3274,25 @@ var binOpExprWithDecInt = TableTest{ SQLs: sqls( "select d & b from binoptestdec_i;", ), - ExpErr: "operator '&' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '&' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d | b from binoptestdec_i;", ), - ExpErr: "operator '|' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '|' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d << b from binoptestdec_i;", ), - ExpErr: "operator '<<' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '<<' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d >> b from binoptestdec_i;", ), - ExpErr: "operator '>>' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '>>' incompatible with type 'decimal(2)'", }, { SQLs: sqls( @@ -3346,13 +3346,13 @@ var binOpExprWithDecInt = TableTest{ SQLs: sqls( "select d % b from binoptestdec_i;", ), - ExpErr: "operator '%' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '%' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d || b from binoptestdec_i;", ), - ExpErr: "operator '||' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '||' incompatible with type 'decimal(2)'", }, }, } @@ -3374,97 +3374,97 @@ var binOpExprWithDecBool = TableTest{ SQLs: sqls( "select d != b from binoptestdec_b;", ), - ExpErr: "types 'DECIMAL(2)' and 'BOOL' are not equatable", + ExpErr: "types 'decimal(2)' and 'bool' are not equatable", }, { SQLs: sqls( "select d = b from binoptestdec_b;", ), - ExpErr: "types 'DECIMAL(2)' and 'BOOL' are not equatable", + ExpErr: "types 'decimal(2)' and 'bool' are not equatable", }, { SQLs: sqls( "select d <= b from binoptestdec_b;", ), - ExpErr: "operator '<=' incompatible with type 'BOOL'", + ExpErr: "operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select d >= b from binoptestdec_b;", ), - ExpErr: "operator '>=' incompatible with type 'BOOL'", + ExpErr: "operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select d < b from binoptestdec_b;", ), - ExpErr: "operator '<' incompatible with type 'BOOL'", + ExpErr: "operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select d > b from binoptestdec_b;", ), - ExpErr: "operator '>' incompatible with type 'BOOL'", + ExpErr: "operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select d & b from binoptestdec_b;", ), - ExpErr: "operator '&' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '&' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d | b from binoptestdec_b;", ), - ExpErr: "operator '|' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '|' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d << b from binoptestdec_b;", ), - ExpErr: "operator '<<' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '<<' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d >> b from binoptestdec_b;", ), - ExpErr: "operator '>>' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '>>' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d + b from binoptestdec_b;", ), - ExpErr: "operator '+' incompatible with type 'BOOL'", + ExpErr: "operator '+' incompatible with type 'bool'", }, { SQLs: sqls( "select d - b from binoptestdec_b;", ), - ExpErr: "operator '-' incompatible with type 'BOOL'", + ExpErr: "operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select d * b from binoptestdec_b;", ), - ExpErr: "operator '*' incompatible with type 'BOOL'", + ExpErr: "operator '*' incompatible with type 'bool'", }, { SQLs: sqls( "select d / b from binoptestdec_b;", ), - ExpErr: "operator '/' incompatible with type 'BOOL'", + ExpErr: "operator '/' incompatible with type 'bool'", }, { SQLs: sqls( "select d % b from binoptestdec_b;", ), - ExpErr: "operator '%' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '%' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d || b from binoptestdec_b;", ), - ExpErr: "operator '||' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '||' incompatible with type 'decimal(2)'", }, }, } @@ -3558,25 +3558,25 @@ var binOpExprWithDecID = TableTest{ SQLs: sqls( "select d & b from binoptestdec_id;", ), - ExpErr: "operator '&' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '&' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d | b from binoptestdec_id;", ), - ExpErr: "operator '|' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '|' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d << b from binoptestdec_id;", ), - ExpErr: "operator '<<' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '<<' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d >> b from binoptestdec_id;", ), - ExpErr: "operator '>>' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '>>' incompatible with type 'decimal(2)'", }, { SQLs: sqls( @@ -3630,13 +3630,13 @@ var binOpExprWithDecID = TableTest{ SQLs: sqls( "select d % b from binoptestdec_id;", ), - ExpErr: "operator '%' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '%' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select d || b from binoptestdec_id;", ), - ExpErr: "operator '||' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '||' incompatible with type 'decimal(2)'", }, }, } @@ -3730,25 +3730,25 @@ var binOpExprWithDecDecimal = TableTest{ SQLs: sqls( "select a & d from binoptestdec_d;", ), - ExpErr: "operator '&' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '&' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a | d from binoptestdec_d;", ), - ExpErr: "operator '|' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '|' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a << d from binoptestdec_d;", ), - ExpErr: "operator '<<' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '<<' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a >> d from binoptestdec_d;", ), - ExpErr: "operator '>>' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '>>' incompatible with type 'decimal(2)'", }, { SQLs: sqls( @@ -3802,13 +3802,13 @@ var binOpExprWithDecDecimal = TableTest{ SQLs: sqls( "select a % d from binoptestdec_d;", ), - ExpErr: "operator '%' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '%' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a || d from binoptestdec_d;", ), - ExpErr: "operator '||' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '||' incompatible with type 'decimal(2)'", }, }, } @@ -3830,97 +3830,97 @@ var binOpExprWithDecTimestamp = TableTest{ SQLs: sqls( "select a != ts from binoptestdec_ts;", ), - ExpErr: "types 'DECIMAL(2)' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'decimal(2)' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a = ts from binoptestdec_ts;", ), - ExpErr: "types 'DECIMAL(2)' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'decimal(2)' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a <= ts from binoptestdec_ts;", ), - ExpErr: "types 'DECIMAL(2)' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'decimal(2)' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a >= ts from binoptestdec_ts;", ), - ExpErr: "types 'DECIMAL(2)' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'decimal(2)' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a < ts from binoptestdec_ts;", ), - ExpErr: "types 'DECIMAL(2)' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'decimal(2)' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a > ts from binoptestdec_ts;", ), - ExpErr: "types 'DECIMAL(2)' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'decimal(2)' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a & ts from binoptestdec_ts;", ), - ExpErr: "operator '&' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '&' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a | ts from binoptestdec_ts;", ), - ExpErr: "operator '|' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '|' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a << ts from binoptestdec_ts;", ), - ExpErr: "operator '<<' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '<<' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a >> ts from binoptestdec_ts;", ), - ExpErr: "operator '>>' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '>>' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a + ts from binoptestdec_ts;", ), - ExpErr: "operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a - ts from binoptestdec_ts;", ), - ExpErr: "operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a * ts from binoptestdec_ts;", ), - ExpErr: "operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a / ts from binoptestdec_ts;", ), - ExpErr: "operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a % ts from binoptestdec_ts;", ), - ExpErr: "operator '%' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '%' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a || ts from binoptestdec_ts;", ), - ExpErr: "operator '||' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '||' incompatible with type 'decimal(2)'", }, }, } @@ -3942,97 +3942,97 @@ var binOpExprWithDecIDSet = TableTest{ SQLs: sqls( "select a != b from binoptestdec_ids;", ), - ExpErr: "types 'DECIMAL(2)' and 'IDSET' are not equatable", + ExpErr: "types 'decimal(2)' and 'idset' are not equatable", }, { SQLs: sqls( "select a = b from binoptestdec_ids;", ), - ExpErr: "types 'DECIMAL(2)' and 'IDSET' are not equatable", + ExpErr: "types 'decimal(2)' and 'idset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestdec_ids;", ), - ExpErr: " operator '<=' incompatible with type 'IDSET'", + ExpErr: " operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select a >= b from binoptestdec_ids;", ), - ExpErr: " operator '>=' incompatible with type 'IDSET'", + ExpErr: " operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select a < b from binoptestdec_ids;", ), - ExpErr: " operator '<' incompatible with type 'IDSET'", + ExpErr: " operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select a > b from binoptestdec_ids;", ), - ExpErr: " operator '>' incompatible with type 'IDSET'", + ExpErr: " operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select a & b from binoptestdec_ids;", ), - ExpErr: " operator '&' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '&' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a | b from binoptestdec_ids;", ), - ExpErr: " operator '|' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '|' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a << b from binoptestdec_ids;", ), - ExpErr: " operator '<<' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '<<' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a >> b from binoptestdec_ids;", ), - ExpErr: " operator '>>' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '>>' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a + b from binoptestdec_ids;", ), - ExpErr: " operator '+' incompatible with type 'IDSET'", + ExpErr: " operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select a - b from binoptestdec_ids;", ), - ExpErr: " operator '-' incompatible with type 'IDSET'", + ExpErr: " operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select a * b from binoptestdec_ids;", ), - ExpErr: " operator '*' incompatible with type 'IDSET'", + ExpErr: " operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select a / b from binoptestdec_ids;", ), - ExpErr: " operator '/' incompatible with type 'IDSET'", + ExpErr: " operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select a % b from binoptestdec_ids;", ), - ExpErr: " operator '%' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '%' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a || b from binoptestdec_ids;", ), - ExpErr: "operator '||' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '||' incompatible with type 'decimal(2)'", }, }, } @@ -4054,97 +4054,97 @@ var binOpExprWithDecString = TableTest{ SQLs: sqls( "select a != b from binoptestdec_s;", ), - ExpErr: "types 'DECIMAL(2)' and 'STRING' are not equatable", + ExpErr: "types 'decimal(2)' and 'string' are not equatable", }, { SQLs: sqls( "select a = b from binoptestdec_s;", ), - ExpErr: "types 'DECIMAL(2)' and 'STRING' are not equatable", + ExpErr: "types 'decimal(2)' and 'string' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestdec_s;", ), - ExpErr: " operator '<=' incompatible with type 'STRING'", + ExpErr: " operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select a >= b from binoptestdec_s;", ), - ExpErr: " operator '>=' incompatible with type 'STRING'", + ExpErr: " operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select a < b from binoptestdec_s;", ), - ExpErr: " operator '<' incompatible with type 'STRING'", + ExpErr: " operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select a > b from binoptestdec_s;", ), - ExpErr: " operator '>' incompatible with type 'STRING'", + ExpErr: " operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select a & b from binoptestdec_s;", ), - ExpErr: " operator '&' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '&' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a | b from binoptestdec_s;", ), - ExpErr: " operator '|' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '|' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a << b from binoptestdec_s;", ), - ExpErr: " operator '<<' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '<<' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a >> b from binoptestdec_s;", ), - ExpErr: " operator '>>' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '>>' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a + b from binoptestdec_s;", ), - ExpErr: " operator '+' incompatible with type 'STRING'", + ExpErr: " operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select a - b from binoptestdec_s;", ), - ExpErr: " operator '-' incompatible with type 'STRING'", + ExpErr: " operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select a * b from binoptestdec_s;", ), - ExpErr: " operator '*' incompatible with type 'STRING'", + ExpErr: " operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select a / b from binoptestdec_s;", ), - ExpErr: " operator '/' incompatible with type 'STRING'", + ExpErr: " operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select a % b from binoptestdec_s;", ), - ExpErr: " operator '%' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '%' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a || b from binoptestdec_s;", ), - ExpErr: "operator '||' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '||' incompatible with type 'decimal(2)'", }, }, } @@ -4166,97 +4166,97 @@ var binOpExprWithDecStringSet = TableTest{ SQLs: sqls( "select a != b from binoptestdec_ss;", ), - ExpErr: "types 'DECIMAL(2)' and 'STRINGSET' are not equatable", + ExpErr: "types 'decimal(2)' and 'stringset' are not equatable", }, { SQLs: sqls( "select a = b from binoptestdec_ss;", ), - ExpErr: "types 'DECIMAL(2)' and 'STRINGSET' are not equatable", + ExpErr: "types 'decimal(2)' and 'stringset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestdec_ss;", ), - ExpErr: " operator '<=' incompatible with type 'STRINGSET'", + ExpErr: " operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >= b from binoptestdec_ss;", ), - ExpErr: " operator '>=' incompatible with type 'STRINGSET'", + ExpErr: " operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a < b from binoptestdec_ss;", ), - ExpErr: " operator '<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a > b from binoptestdec_ss;", ), - ExpErr: " operator '>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a & b from binoptestdec_ss;", ), - ExpErr: " operator '&' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '&' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a | b from binoptestdec_ss;", ), - ExpErr: " operator '|' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '|' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a << b from binoptestdec_ss;", ), - ExpErr: " operator '<<' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '<<' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a >> b from binoptestdec_ss;", ), - ExpErr: " operator '>>' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '>>' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a + b from binoptestdec_ss;", ), - ExpErr: " operator '+' incompatible with type 'STRINGSET'", + ExpErr: " operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select a - b from binoptestdec_ss;", ), - ExpErr: " operator '-' incompatible with type 'STRINGSET'", + ExpErr: " operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select a * b from binoptestdec_ss;", ), - ExpErr: " operator '*' incompatible with type 'STRINGSET'", + ExpErr: " operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select a / b from binoptestdec_ss;", ), - ExpErr: " operator '/' incompatible with type 'STRINGSET'", + ExpErr: " operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select a % b from binoptestdec_ss;", ), - ExpErr: " operator '%' incompatible with type 'DECIMAL(2)'", + ExpErr: " operator '%' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select a || b from binoptestdec_ss;", ), - ExpErr: "operator '||' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '||' incompatible with type 'decimal(2)'", }, }, } @@ -4279,97 +4279,97 @@ var binOpExprWithTSInt = TableTest{ SQLs: sqls( "select d != b from binoptestts_i;", ), - ExpErr: "types 'TIMESTAMP' and 'INT' are not equatable", + ExpErr: "types 'timestamp' and 'int' are not equatable", }, { SQLs: sqls( "select d = b from binoptestts_i;", ), - ExpErr: "types 'TIMESTAMP' and 'INT' are not equatable", + ExpErr: "types 'timestamp' and 'int' are not equatable", }, { SQLs: sqls( "select d <= b from binoptestts_i;", ), - ExpErr: "types 'TIMESTAMP' and 'INT' are not equatable", + ExpErr: "types 'timestamp' and 'int' are not equatable", }, { SQLs: sqls( "select d >= b from binoptestts_i;", ), - ExpErr: "types 'TIMESTAMP' and 'INT' are not equatable", + ExpErr: "types 'timestamp' and 'int' are not equatable", }, { SQLs: sqls( "select d < b from binoptestts_i;", ), - ExpErr: "types 'TIMESTAMP' and 'INT' are not equatable", + ExpErr: "types 'timestamp' and 'int' are not equatable", }, { SQLs: sqls( "select d > b from binoptestts_i;", ), - ExpErr: "types 'TIMESTAMP' and 'INT' are not equatable", + ExpErr: "types 'timestamp' and 'int' are not equatable", }, { SQLs: sqls( "select d & b from binoptestts_i;", ), - ExpErr: "operator '&' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '&' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d | b from binoptestts_i;", ), - ExpErr: "operator '|' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '|' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d << b from binoptestts_i;", ), - ExpErr: "operator '<<' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '<<' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d >> b from binoptestts_i;", ), - ExpErr: "operator '>>' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '>>' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d + b from binoptestts_i;", ), - ExpErr: "operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d - b from binoptestts_i;", ), - ExpErr: "operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d * b from binoptestts_i;", ), - ExpErr: "operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d / b from binoptestts_i;", ), - ExpErr: "operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d % b from binoptestts_i;", ), - ExpErr: "operator '%' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '%' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d || b from binoptestts_i;", ), - ExpErr: "operator '||' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '||' incompatible with type 'timestamp'", }, }, } @@ -4391,97 +4391,97 @@ var binOpExprWithTSBool = TableTest{ SQLs: sqls( "select d != b from binoptestts_b;", ), - ExpErr: "types 'TIMESTAMP' and 'BOOL' are not equatable", + ExpErr: "types 'timestamp' and 'bool' are not equatable", }, { SQLs: sqls( "select d = b from binoptestts_b;", ), - ExpErr: "types 'TIMESTAMP' and 'BOOL' are not equatable", + ExpErr: "types 'timestamp' and 'bool' are not equatable", }, { SQLs: sqls( "select d <= b from binoptestts_b;", ), - ExpErr: "operator '<=' incompatible with type 'BOOL'", + ExpErr: "operator '<=' incompatible with type 'bool'", }, { SQLs: sqls( "select d >= b from binoptestts_b;", ), - ExpErr: "operator '>=' incompatible with type 'BOOL'", + ExpErr: "operator '>=' incompatible with type 'bool'", }, { SQLs: sqls( "select d < b from binoptestts_b;", ), - ExpErr: "operator '<' incompatible with type 'BOOL'", + ExpErr: "operator '<' incompatible with type 'bool'", }, { SQLs: sqls( "select d > b from binoptestts_b;", ), - ExpErr: "operator '>' incompatible with type 'BOOL'", + ExpErr: "operator '>' incompatible with type 'bool'", }, { SQLs: sqls( "select d & b from binoptestts_b;", ), - ExpErr: "operator '&' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '&' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d | b from binoptestts_b;", ), - ExpErr: "operator '|' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '|' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d << b from binoptestts_b;", ), - ExpErr: "operator '<<' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '<<' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d >> b from binoptestts_b;", ), - ExpErr: "operator '>>' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '>>' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d + b from binoptestts_b;", ), - ExpErr: "operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d - b from binoptestts_b;", ), - ExpErr: "operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d * b from binoptestts_b;", ), - ExpErr: "operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d / b from binoptestts_b;", ), - ExpErr: "operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d % b from binoptestts_b;", ), - ExpErr: "operator '%' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '%' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d || b from binoptestts_b;", ), - ExpErr: "operator '||' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '||' incompatible with type 'timestamp'", }, }, } @@ -4503,97 +4503,97 @@ var binOpExprWithTSID = TableTest{ SQLs: sqls( "select d != b from binoptestts_id;", ), - ExpErr: "types 'TIMESTAMP' and 'ID' are not equatable", + ExpErr: "types 'timestamp' and 'id' are not equatable", }, { SQLs: sqls( "select d = b from binoptestts_id;", ), - ExpErr: "types 'TIMESTAMP' and 'ID' are not equatable", + ExpErr: "types 'timestamp' and 'id' are not equatable", }, { SQLs: sqls( "select d <= b from binoptestts_id;", ), - ExpErr: "types 'TIMESTAMP' and 'ID' are not equatable", + ExpErr: "types 'timestamp' and 'id' are not equatable", }, { SQLs: sqls( "select d >= b from binoptestts_id;", ), - ExpErr: "types 'TIMESTAMP' and 'ID' are not equatable", + ExpErr: "types 'timestamp' and 'id' are not equatable", }, { SQLs: sqls( "select d < b from binoptestts_id;", ), - ExpErr: "types 'TIMESTAMP' and 'ID' are not equatable", + ExpErr: "types 'timestamp' and 'id' are not equatable", }, { SQLs: sqls( "select d > b from binoptestts_id;", ), - ExpErr: "types 'TIMESTAMP' and 'ID' are not equatable", + ExpErr: "types 'timestamp' and 'id' are not equatable", }, { SQLs: sqls( "select d & b from binoptestts_id;", ), - ExpErr: "operator '&' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '&' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d | b from binoptestts_id;", ), - ExpErr: "operator '|' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '|' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d << b from binoptestts_id;", ), - ExpErr: "operator '<<' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '<<' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d >> b from binoptestts_id;", ), - ExpErr: "operator '>>' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '>>' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d + b from binoptestts_id;", ), - ExpErr: "operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d - b from binoptestts_id;", ), - ExpErr: "operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d * b from binoptestts_id;", ), - ExpErr: "operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d / b from binoptestts_id;", ), - ExpErr: "operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d % b from binoptestts_id;", ), - ExpErr: "operator '%' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '%' incompatible with type 'timestamp'", }, { SQLs: sqls( "select d || b from binoptestts_id;", ), - ExpErr: "operator '||' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '||' incompatible with type 'timestamp'", }, }, } @@ -4615,97 +4615,97 @@ var binOpExprWithTSDecimal = TableTest{ SQLs: sqls( "select a != d from binoptestts_d;", ), - ExpErr: "types 'TIMESTAMP' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'timestamp' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a = d from binoptestts_d;", ), - ExpErr: "types 'TIMESTAMP' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'timestamp' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a <= d from binoptestts_d;", ), - ExpErr: "types 'TIMESTAMP' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'timestamp' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a >= d from binoptestts_d;", ), - ExpErr: "types 'TIMESTAMP' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'timestamp' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a < d from binoptestts_d;", ), - ExpErr: "types 'TIMESTAMP' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'timestamp' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a > d from binoptestts_d;", ), - ExpErr: "types 'TIMESTAMP' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'timestamp' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a & d from binoptestts_d;", ), - ExpErr: "operator '&' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '&' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a | d from binoptestts_d;", ), - ExpErr: "operator '|' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '|' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a << d from binoptestts_d;", ), - ExpErr: "operator '<<' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '<<' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a >> d from binoptestts_d;", ), - ExpErr: "operator '>>' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '>>' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a + d from binoptestts_d;", ), - ExpErr: "operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a - d from binoptestts_d;", ), - ExpErr: "operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a * d from binoptestts_d;", ), - ExpErr: "operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a / d from binoptestts_d;", ), - ExpErr: "operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a % d from binoptestts_d;", ), - ExpErr: "operator '%' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '%' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a || d from binoptestts_d;", ), - ExpErr: "operator '||' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '||' incompatible with type 'timestamp'", }, }, } @@ -4794,61 +4794,61 @@ var binOpExprWithTSTimestamp = TableTest{ SQLs: sqls( "select a & ts from binoptestts_ts;", ), - ExpErr: "operator '&' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '&' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a | ts from binoptestts_ts;", ), - ExpErr: "operator '|' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '|' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a << ts from binoptestts_ts;", ), - ExpErr: "operator '<<' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '<<' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a >> ts from binoptestts_ts;", ), - ExpErr: "operator '>>' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '>>' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a + ts from binoptestts_ts;", ), - ExpErr: "operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a - ts from binoptestts_ts;", ), - ExpErr: "operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a * ts from binoptestts_ts;", ), - ExpErr: "operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a / ts from binoptestts_ts;", ), - ExpErr: "operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a % ts from binoptestts_ts;", ), - ExpErr: "operator '%' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '%' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a || ts from binoptestts_ts;", ), - ExpErr: "operator '||' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '||' incompatible with type 'timestamp'", }, }, } @@ -4870,97 +4870,97 @@ var binOpExprWithTSIDSet = TableTest{ SQLs: sqls( "select a != b from binoptestts_ids;", ), - ExpErr: "types 'TIMESTAMP' and 'IDSET' are not equatable", + ExpErr: "types 'timestamp' and 'idset' are not equatable", }, { SQLs: sqls( "select a = b from binoptestts_ids;", ), - ExpErr: "types 'TIMESTAMP' and 'IDSET' are not equatable", + ExpErr: "types 'timestamp' and 'idset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestts_ids;", ), - ExpErr: " operator '<=' incompatible with type 'IDSET'", + ExpErr: " operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select a >= b from binoptestts_ids;", ), - ExpErr: " operator '>=' incompatible with type 'IDSET'", + ExpErr: " operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select a < b from binoptestts_ids;", ), - ExpErr: " operator '<' incompatible with type 'IDSET'", + ExpErr: " operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select a > b from binoptestts_ids;", ), - ExpErr: " operator '>' incompatible with type 'IDSET'", + ExpErr: " operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select a & b from binoptestts_ids;", ), - ExpErr: " operator '&' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '&' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a | b from binoptestts_ids;", ), - ExpErr: " operator '|' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '|' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a << b from binoptestts_ids;", ), - ExpErr: " operator '<<' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '<<' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a >> b from binoptestts_ids;", ), - ExpErr: " operator '>>' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '>>' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a + b from binoptestts_ids;", ), - ExpErr: " operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a - b from binoptestts_ids;", ), - ExpErr: " operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a * b from binoptestts_ids;", ), - ExpErr: " operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a / b from binoptestts_ids;", ), - ExpErr: " operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a % b from binoptestts_ids;", ), - ExpErr: " operator '%' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '%' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a || b from binoptestts_ids;", ), - ExpErr: "operator '||' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '||' incompatible with type 'timestamp'", }, }, } @@ -4982,97 +4982,97 @@ var binOpExprWithTSString = TableTest{ SQLs: sqls( "select a != b from binoptestts_s;", ), - ExpErr: "types 'TIMESTAMP' and 'STRING' are not equatable", + ExpErr: "types 'timestamp' and 'string' are not equatable", }, { SQLs: sqls( "select a = b from binoptestts_s;", ), - ExpErr: "types 'TIMESTAMP' and 'STRING' are not equatable", + ExpErr: "types 'timestamp' and 'string' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestts_s;", ), - ExpErr: " operator '<=' incompatible with type 'STRING'", + ExpErr: " operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select a >= b from binoptestts_s;", ), - ExpErr: " operator '>=' incompatible with type 'STRING'", + ExpErr: " operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select a < b from binoptestts_s;", ), - ExpErr: " operator '<' incompatible with type 'STRING'", + ExpErr: " operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select a > b from binoptestts_s;", ), - ExpErr: " operator '>' incompatible with type 'STRING'", + ExpErr: " operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select a & b from binoptestts_s;", ), - ExpErr: " operator '&' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '&' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a | b from binoptestts_s;", ), - ExpErr: " operator '|' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '|' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a << b from binoptestts_s;", ), - ExpErr: " operator '<<' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '<<' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a >> b from binoptestts_s;", ), - ExpErr: " operator '>>' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '>>' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a + b from binoptestts_s;", ), - ExpErr: " operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a - b from binoptestts_s;", ), - ExpErr: " operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a * b from binoptestts_s;", ), - ExpErr: " operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a / b from binoptestts_s;", ), - ExpErr: " operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a % b from binoptestts_s;", ), - ExpErr: " operator '%' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '%' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a || b from binoptestts_s;", ), - ExpErr: "operator '||' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '||' incompatible with type 'timestamp'", }, }, } @@ -5094,97 +5094,97 @@ var binOpExprWithTSStringSet = TableTest{ SQLs: sqls( "select a != b from binoptestts_ss;", ), - ExpErr: "types 'TIMESTAMP' and 'STRINGSET' are not equatable", + ExpErr: "types 'timestamp' and 'stringset' are not equatable", }, { SQLs: sqls( "select a = b from binoptestts_ss;", ), - ExpErr: "types 'TIMESTAMP' and 'STRINGSET' are not equatable", + ExpErr: "types 'timestamp' and 'stringset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestts_ss;", ), - ExpErr: " operator '<=' incompatible with type 'STRINGSET'", + ExpErr: " operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >= b from binoptestts_ss;", ), - ExpErr: " operator '>=' incompatible with type 'STRINGSET'", + ExpErr: " operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a < b from binoptestts_ss;", ), - ExpErr: " operator '<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a > b from binoptestts_ss;", ), - ExpErr: " operator '>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a & b from binoptestts_ss;", ), - ExpErr: " operator '&' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '&' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a | b from binoptestts_ss;", ), - ExpErr: " operator '|' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '|' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a << b from binoptestts_ss;", ), - ExpErr: " operator '<<' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '<<' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a >> b from binoptestts_ss;", ), - ExpErr: " operator '>>' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '>>' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a + b from binoptestts_ss;", ), - ExpErr: " operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '+' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a - b from binoptestts_ss;", ), - ExpErr: " operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a * b from binoptestts_ss;", ), - ExpErr: " operator '*' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '*' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a / b from binoptestts_ss;", ), - ExpErr: " operator '/' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '/' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a % b from binoptestts_ss;", ), - ExpErr: " operator '%' incompatible with type 'TIMESTAMP'", + ExpErr: " operator '%' incompatible with type 'timestamp'", }, { SQLs: sqls( "select a || b from binoptestts_ss;", ), - ExpErr: "operator '||' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '||' incompatible with type 'timestamp'", }, }, } @@ -5207,97 +5207,97 @@ var binOpExprWithIDSetInt = TableTest{ SQLs: sqls( "select d != b from binoptestids_i;", ), - ExpErr: "types 'IDSET' and 'INT' are not equatable", + ExpErr: "types 'idset' and 'int' are not equatable", }, { SQLs: sqls( "select d = b from binoptestids_i;", ), - ExpErr: "types 'IDSET' and 'INT' are not equatable", + ExpErr: "types 'idset' and 'int' are not equatable", }, { SQLs: sqls( "select d <= b from binoptestids_i;", ), - ExpErr: "operator '<=' incompatible with type 'IDSET'", + ExpErr: "operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select d >= b from binoptestids_i;", ), - ExpErr: "operator '>=' incompatible with type 'IDSET'", + ExpErr: "operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select d < b from binoptestids_i;", ), - ExpErr: "operator '<' incompatible with type 'IDSET'", + ExpErr: "operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select d > b from binoptestids_i;", ), - ExpErr: "operator '>' incompatible with type 'IDSET'", + ExpErr: "operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select d & b from binoptestids_i;", ), - ExpErr: "operator '&' incompatible with type 'IDSET'", + ExpErr: "operator '&' incompatible with type 'idset'", }, { SQLs: sqls( "select d | b from binoptestids_i;", ), - ExpErr: "operator '|' incompatible with type 'IDSET'", + ExpErr: "operator '|' incompatible with type 'idset'", }, { SQLs: sqls( "select d << b from binoptestids_i;", ), - ExpErr: "operator '<<' incompatible with type 'IDSET'", + ExpErr: "operator '<<' incompatible with type 'idset'", }, { SQLs: sqls( "select d >> b from binoptestids_i;", ), - ExpErr: "operator '>>' incompatible with type 'IDSET'", + ExpErr: "operator '>>' incompatible with type 'idset'", }, { SQLs: sqls( "select d + b from binoptestids_i;", ), - ExpErr: "operator '+' incompatible with type 'IDSET'", + ExpErr: "operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select d - b from binoptestids_i;", ), - ExpErr: "operator '-' incompatible with type 'IDSET'", + ExpErr: "operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select d * b from binoptestids_i;", ), - ExpErr: "operator '*' incompatible with type 'IDSET'", + ExpErr: "operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select d / b from binoptestids_i;", ), - ExpErr: "operator '/' incompatible with type 'IDSET'", + ExpErr: "operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select d % b from binoptestids_i;", ), - ExpErr: "operator '%' incompatible with type 'IDSET'", + ExpErr: "operator '%' incompatible with type 'idset'", }, { SQLs: sqls( "select d || b from binoptestids_i;", ), - ExpErr: "operator '||' incompatible with type 'IDSET'", + ExpErr: "operator '||' incompatible with type 'idset'", }, }, } @@ -5319,97 +5319,97 @@ var binOpExprWithIDSetBool = TableTest{ SQLs: sqls( "select d != b from binoptestids_b;", ), - ExpErr: "types 'IDSET' and 'BOOL' are not equatable", + ExpErr: "types 'idset' and 'bool' are not equatable", }, { SQLs: sqls( "select d = b from binoptestids_b;", ), - ExpErr: "types 'IDSET' and 'BOOL' are not equatable", + ExpErr: "types 'idset' and 'bool' are not equatable", }, { SQLs: sqls( "select d <= b from binoptestids_b;", ), - ExpErr: "operator '<=' incompatible with type 'IDSET'", + ExpErr: "operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select d >= b from binoptestids_b;", ), - ExpErr: "operator '>=' incompatible with type 'IDSET'", + ExpErr: "operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select d < b from binoptestids_b;", ), - ExpErr: "operator '<' incompatible with type 'IDSET'", + ExpErr: "operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select d > b from binoptestids_b;", ), - ExpErr: "operator '>' incompatible with type 'IDSET'", + ExpErr: "operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select d & b from binoptestids_b;", ), - ExpErr: "operator '&' incompatible with type 'IDSET'", + ExpErr: "operator '&' incompatible with type 'idset'", }, { SQLs: sqls( "select d | b from binoptestids_b;", ), - ExpErr: "operator '|' incompatible with type 'IDSET'", + ExpErr: "operator '|' incompatible with type 'idset'", }, { SQLs: sqls( "select d << b from binoptestids_b;", ), - ExpErr: "operator '<<' incompatible with type 'IDSET'", + ExpErr: "operator '<<' incompatible with type 'idset'", }, { SQLs: sqls( "select d >> b from binoptestids_b;", ), - ExpErr: "operator '>>' incompatible with type 'IDSET'", + ExpErr: "operator '>>' incompatible with type 'idset'", }, { SQLs: sqls( "select d + b from binoptestids_b;", ), - ExpErr: "operator '+' incompatible with type 'IDSET'", + ExpErr: "operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select d - b from binoptestids_b;", ), - ExpErr: "operator '-' incompatible with type 'IDSET'", + ExpErr: "operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select d * b from binoptestids_b;", ), - ExpErr: "operator '*' incompatible with type 'IDSET'", + ExpErr: "operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select d / b from binoptestids_b;", ), - ExpErr: "operator '/' incompatible with type 'IDSET'", + ExpErr: "operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select d % b from binoptestids_b;", ), - ExpErr: "operator '%' incompatible with type 'IDSET'", + ExpErr: "operator '%' incompatible with type 'idset'", }, { SQLs: sqls( "select d || b from binoptestids_b;", ), - ExpErr: "operator '||' incompatible with type 'IDSET'", + ExpErr: "operator '||' incompatible with type 'idset'", }, }, } @@ -5431,97 +5431,97 @@ var binOpExprWithIDSetID = TableTest{ SQLs: sqls( "select d != b from binoptestids_id;", ), - ExpErr: "types 'IDSET' and 'ID' are not equatable", + ExpErr: "types 'idset' and 'id' are not equatable", }, { SQLs: sqls( "select d = b from binoptestids_id;", ), - ExpErr: "types 'IDSET' and 'ID' are not equatable", + ExpErr: "types 'idset' and 'id' are not equatable", }, { SQLs: sqls( "select d <= b from binoptestids_id;", ), - ExpErr: "operator '<=' incompatible with type 'IDSET'", + ExpErr: "operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select d >= b from binoptestids_id;", ), - ExpErr: "operator '>=' incompatible with type 'IDSET'", + ExpErr: "operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select d < b from binoptestids_id;", ), - ExpErr: "operator '<' incompatible with type 'IDSET'", + ExpErr: "operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select d > b from binoptestids_id;", ), - ExpErr: "operator '>' incompatible with type 'IDSET'", + ExpErr: "operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select d & b from binoptestids_id;", ), - ExpErr: "operator '&' incompatible with type 'IDSET'", + ExpErr: "operator '&' incompatible with type 'idset'", }, { SQLs: sqls( "select d | b from binoptestids_id;", ), - ExpErr: "operator '|' incompatible with type 'IDSET'", + ExpErr: "operator '|' incompatible with type 'idset'", }, { SQLs: sqls( "select d << b from binoptestids_id;", ), - ExpErr: "operator '<<' incompatible with type 'IDSET'", + ExpErr: "operator '<<' incompatible with type 'idset'", }, { SQLs: sqls( "select d >> b from binoptestids_id;", ), - ExpErr: "operator '>>' incompatible with type 'IDSET'", + ExpErr: "operator '>>' incompatible with type 'idset'", }, { SQLs: sqls( "select d + b from binoptestids_id;", ), - ExpErr: "operator '+' incompatible with type 'IDSET'", + ExpErr: "operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select d - b from binoptestids_id;", ), - ExpErr: "operator '-' incompatible with type 'IDSET'", + ExpErr: "operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select d * b from binoptestids_id;", ), - ExpErr: "operator '*' incompatible with type 'IDSET'", + ExpErr: "operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select d / b from binoptestids_id;", ), - ExpErr: "operator '/' incompatible with type 'IDSET'", + ExpErr: "operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select d % b from binoptestids_id;", ), - ExpErr: "operator '%' incompatible with type 'IDSET'", + ExpErr: "operator '%' incompatible with type 'idset'", }, { SQLs: sqls( "select d || b from binoptestids_id;", ), - ExpErr: "operator '||' incompatible with type 'IDSET'", + ExpErr: "operator '||' incompatible with type 'idset'", }, }, } @@ -5543,97 +5543,97 @@ var binOpExprWithIDSetDecimal = TableTest{ SQLs: sqls( "select a != d from binoptestids_d;", ), - ExpErr: "types 'IDSET' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'idset' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a = d from binoptestids_d;", ), - ExpErr: "types 'IDSET' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'idset' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a <= d from binoptestids_d;", ), - ExpErr: "operator '<=' incompatible with type 'IDSET'", + ExpErr: "operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select a >= d from binoptestids_d;", ), - ExpErr: "operator '>=' incompatible with type 'IDSET'", + ExpErr: "operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select a < d from binoptestids_d;", ), - ExpErr: "operator '<' incompatible with type 'IDSET'", + ExpErr: "operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select a > d from binoptestids_d;", ), - ExpErr: "operator '>' incompatible with type 'IDSET'", + ExpErr: "operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select a & d from binoptestids_d;", ), - ExpErr: "operator '&' incompatible with type 'IDSET'", + ExpErr: "operator '&' incompatible with type 'idset'", }, { SQLs: sqls( "select a | d from binoptestids_d;", ), - ExpErr: "operator '|' incompatible with type 'IDSET'", + ExpErr: "operator '|' incompatible with type 'idset'", }, { SQLs: sqls( "select a << d from binoptestids_d;", ), - ExpErr: "operator '<<' incompatible with type 'IDSET'", + ExpErr: "operator '<<' incompatible with type 'idset'", }, { SQLs: sqls( "select a >> d from binoptestids_d;", ), - ExpErr: "operator '>>' incompatible with type 'IDSET'", + ExpErr: "operator '>>' incompatible with type 'idset'", }, { SQLs: sqls( "select a + d from binoptestids_d;", ), - ExpErr: "operator '+' incompatible with type 'IDSET'", + ExpErr: "operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select a - d from binoptestids_d;", ), - ExpErr: "operator '-' incompatible with type 'IDSET'", + ExpErr: "operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select a * d from binoptestids_d;", ), - ExpErr: "operator '*' incompatible with type 'IDSET'", + ExpErr: "operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select a / d from binoptestids_d;", ), - ExpErr: "operator '/' incompatible with type 'IDSET'", + ExpErr: "operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select a % d from binoptestids_d;", ), - ExpErr: "operator '%' incompatible with type 'IDSET'", + ExpErr: "operator '%' incompatible with type 'idset'", }, { SQLs: sqls( "select a || d from binoptestids_d;", ), - ExpErr: "operator '||' incompatible with type 'IDSET'", + ExpErr: "operator '||' incompatible with type 'idset'", }, }, } @@ -5655,97 +5655,97 @@ var binOpExprWithIDSetTimestamp = TableTest{ SQLs: sqls( "select a != ts from binoptestids_ts;", ), - ExpErr: "types 'IDSET' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'idset' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a = ts from binoptestids_ts;", ), - ExpErr: "types 'IDSET' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'idset' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a <= ts from binoptestids_ts;", ), - ExpErr: " operator '<=' incompatible with type 'IDSET'", + ExpErr: " operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select a >= ts from binoptestids_ts;", ), - ExpErr: " operator '>=' incompatible with type 'IDSET'", + ExpErr: " operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select a < ts from binoptestids_ts;", ), - ExpErr: " operator '<' incompatible with type 'IDSET'", + ExpErr: " operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select a > ts from binoptestids_ts;", ), - ExpErr: " operator '>' incompatible with type 'IDSET'", + ExpErr: " operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select a & ts from binoptestids_ts;", ), - ExpErr: "operator '&' incompatible with type 'IDSET'", + ExpErr: "operator '&' incompatible with type 'idset'", }, { SQLs: sqls( "select a | ts from binoptestids_ts;", ), - ExpErr: "operator '|' incompatible with type 'IDSET'", + ExpErr: "operator '|' incompatible with type 'idset'", }, { SQLs: sqls( "select a << ts from binoptestids_ts;", ), - ExpErr: "operator '<<' incompatible with type 'IDSET'", + ExpErr: "operator '<<' incompatible with type 'idset'", }, { SQLs: sqls( "select a >> ts from binoptestids_ts;", ), - ExpErr: "operator '>>' incompatible with type 'IDSET'", + ExpErr: "operator '>>' incompatible with type 'idset'", }, { SQLs: sqls( "select a + ts from binoptestids_ts;", ), - ExpErr: "operator '+' incompatible with type 'IDSET'", + ExpErr: "operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select a - ts from binoptestids_ts;", ), - ExpErr: "operator '-' incompatible with type 'IDSET'", + ExpErr: "operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select a * ts from binoptestids_ts;", ), - ExpErr: "operator '*' incompatible with type 'IDSET'", + ExpErr: "operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select a / ts from binoptestids_ts;", ), - ExpErr: "operator '/' incompatible with type 'IDSET'", + ExpErr: "operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select a % ts from binoptestids_ts;", ), - ExpErr: "operator '%' incompatible with type 'IDSET'", + ExpErr: "operator '%' incompatible with type 'idset'", }, { SQLs: sqls( "select a || ts from binoptestids_ts;", ), - ExpErr: "operator '||' incompatible with type 'IDSET'", + ExpErr: "operator '||' incompatible with type 'idset'", }, }, } @@ -5791,85 +5791,85 @@ var binOpExprWithIDSetIDSet = TableTest{ SQLs: sqls( "select a <= b from binoptestids_ids;", ), - ExpErr: " operator '<=' incompatible with type 'IDSET'", + ExpErr: " operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select a >= b from binoptestids_ids;", ), - ExpErr: " operator '>=' incompatible with type 'IDSET'", + ExpErr: " operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select a < b from binoptestids_ids;", ), - ExpErr: " operator '<' incompatible with type 'IDSET'", + ExpErr: " operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select a > b from binoptestids_ids;", ), - ExpErr: " operator '>' incompatible with type 'IDSET'", + ExpErr: " operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select a & b from binoptestids_ids;", ), - ExpErr: " operator '&' incompatible with type 'IDSET'", + ExpErr: " operator '&' incompatible with type 'idset'", }, { SQLs: sqls( "select a | b from binoptestids_ids;", ), - ExpErr: " operator '|' incompatible with type 'IDSET'", + ExpErr: " operator '|' incompatible with type 'idset'", }, { SQLs: sqls( "select a << b from binoptestids_ids;", ), - ExpErr: " operator '<<' incompatible with type 'IDSET'", + ExpErr: " operator '<<' incompatible with type 'idset'", }, { SQLs: sqls( "select a >> b from binoptestids_ids;", ), - ExpErr: " operator '>>' incompatible with type 'IDSET'", + ExpErr: " operator '>>' incompatible with type 'idset'", }, { SQLs: sqls( "select a + b from binoptestids_ids;", ), - ExpErr: " operator '+' incompatible with type 'IDSET'", + ExpErr: " operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select a - b from binoptestids_ids;", ), - ExpErr: " operator '-' incompatible with type 'IDSET'", + ExpErr: " operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select a * b from binoptestids_ids;", ), - ExpErr: " operator '*' incompatible with type 'IDSET'", + ExpErr: " operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select a / b from binoptestids_ids;", ), - ExpErr: " operator '/' incompatible with type 'IDSET'", + ExpErr: " operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select a % b from binoptestids_ids;", ), - ExpErr: " operator '%' incompatible with type 'IDSET'", + ExpErr: " operator '%' incompatible with type 'idset'", }, { SQLs: sqls( "select a || b from binoptestids_ids;", ), - ExpErr: "operator '||' incompatible with type 'IDSET'", + ExpErr: "operator '||' incompatible with type 'idset'", }, }, } @@ -5891,97 +5891,97 @@ var binOpExprWithIDSetString = TableTest{ SQLs: sqls( "select a != b from binoptestids_s;", ), - ExpErr: "types 'IDSET' and 'STRING' are not equatable", + ExpErr: "types 'idset' and 'string' are not equatable", }, { SQLs: sqls( "select a = b from binoptestids_s;", ), - ExpErr: "types 'IDSET' and 'STRING' are not equatable", + ExpErr: "types 'idset' and 'string' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestids_s;", ), - ExpErr: " operator '<=' incompatible with type 'IDSET'", + ExpErr: " operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select a >= b from binoptestids_s;", ), - ExpErr: " operator '>=' incompatible with type 'IDSET'", + ExpErr: " operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select a < b from binoptestids_s;", ), - ExpErr: " operator '<' incompatible with type 'IDSET'", + ExpErr: " operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select a > b from binoptestids_s;", ), - ExpErr: " operator '>' incompatible with type 'IDSET'", + ExpErr: " operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select a & b from binoptestids_s;", ), - ExpErr: " operator '&' incompatible with type 'IDSET'", + ExpErr: " operator '&' incompatible with type 'idset'", }, { SQLs: sqls( "select a | b from binoptestids_s;", ), - ExpErr: " operator '|' incompatible with type 'IDSET'", + ExpErr: " operator '|' incompatible with type 'idset'", }, { SQLs: sqls( "select a << b from binoptestids_s;", ), - ExpErr: " operator '<<' incompatible with type 'IDSET'", + ExpErr: " operator '<<' incompatible with type 'idset'", }, { SQLs: sqls( "select a >> b from binoptestids_s;", ), - ExpErr: " operator '>>' incompatible with type 'IDSET'", + ExpErr: " operator '>>' incompatible with type 'idset'", }, { SQLs: sqls( "select a + b from binoptestids_s;", ), - ExpErr: " operator '+' incompatible with type 'IDSET'", + ExpErr: " operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select a - b from binoptestids_s;", ), - ExpErr: " operator '-' incompatible with type 'IDSET'", + ExpErr: " operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select a * b from binoptestids_s;", ), - ExpErr: " operator '*' incompatible with type 'IDSET'", + ExpErr: " operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select a / b from binoptestids_s;", ), - ExpErr: " operator '/' incompatible with type 'IDSET'", + ExpErr: " operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select a % b from binoptestids_s;", ), - ExpErr: " operator '%' incompatible with type 'IDSET'", + ExpErr: " operator '%' incompatible with type 'idset'", }, { SQLs: sqls( "select a || b from binoptestids_s;", ), - ExpErr: "operator '||' incompatible with type 'IDSET'", + ExpErr: "operator '||' incompatible with type 'idset'", }, }, } @@ -6003,97 +6003,97 @@ var binOpExprWithIDSetStringSet = TableTest{ SQLs: sqls( "select a != b from binoptestids_ss;", ), - ExpErr: "types 'IDSET' and 'STRINGSET' are not equatable", + ExpErr: "types 'idset' and 'stringset' are not equatable", }, { SQLs: sqls( "select a = b from binoptestids_ss;", ), - ExpErr: "types 'IDSET' and 'STRINGSET' are not equatable", + ExpErr: "types 'idset' and 'stringset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestids_ss;", ), - ExpErr: " operator '<=' incompatible with type 'IDSET'", + ExpErr: " operator '<=' incompatible with type 'idset'", }, { SQLs: sqls( "select a >= b from binoptestids_ss;", ), - ExpErr: " operator '>=' incompatible with type 'IDSET'", + ExpErr: " operator '>=' incompatible with type 'idset'", }, { SQLs: sqls( "select a < b from binoptestids_ss;", ), - ExpErr: " operator '<' incompatible with type 'IDSET'", + ExpErr: " operator '<' incompatible with type 'idset'", }, { SQLs: sqls( "select a > b from binoptestids_ss;", ), - ExpErr: " operator '>' incompatible with type 'IDSET'", + ExpErr: " operator '>' incompatible with type 'idset'", }, { SQLs: sqls( "select a & b from binoptestids_ss;", ), - ExpErr: " operator '&' incompatible with type 'IDSET'", + ExpErr: " operator '&' incompatible with type 'idset'", }, { SQLs: sqls( "select a | b from binoptestids_ss;", ), - ExpErr: " operator '|' incompatible with type 'IDSET'", + ExpErr: " operator '|' incompatible with type 'idset'", }, { SQLs: sqls( "select a << b from binoptestids_ss;", ), - ExpErr: " operator '<<' incompatible with type 'IDSET'", + ExpErr: " operator '<<' incompatible with type 'idset'", }, { SQLs: sqls( "select a >> b from binoptestids_ss;", ), - ExpErr: " operator '>>' incompatible with type 'IDSET'", + ExpErr: " operator '>>' incompatible with type 'idset'", }, { SQLs: sqls( "select a + b from binoptestids_ss;", ), - ExpErr: " operator '+' incompatible with type 'IDSET'", + ExpErr: " operator '+' incompatible with type 'idset'", }, { SQLs: sqls( "select a - b from binoptestids_ss;", ), - ExpErr: " operator '-' incompatible with type 'IDSET'", + ExpErr: " operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select a * b from binoptestids_ss;", ), - ExpErr: " operator '*' incompatible with type 'IDSET'", + ExpErr: " operator '*' incompatible with type 'idset'", }, { SQLs: sqls( "select a / b from binoptestids_ss;", ), - ExpErr: " operator '/' incompatible with type 'IDSET'", + ExpErr: " operator '/' incompatible with type 'idset'", }, { SQLs: sqls( "select a % b from binoptestids_ss;", ), - ExpErr: " operator '%' incompatible with type 'IDSET'", + ExpErr: " operator '%' incompatible with type 'idset'", }, { SQLs: sqls( "select a || b from binoptestids_ss;", ), - ExpErr: "operator '||' incompatible with type 'IDSET'", + ExpErr: "operator '||' incompatible with type 'idset'", }, }, } @@ -6116,97 +6116,97 @@ var binOpExprWithStringInt = TableTest{ SQLs: sqls( "select d != b from binoptests_i;", ), - ExpErr: "types 'STRING' and 'INT' are not equatable", + ExpErr: "types 'string' and 'int' are not equatable", }, { SQLs: sqls( "select d = b from binoptests_i;", ), - ExpErr: "types 'STRING' and 'INT' are not equatable", + ExpErr: "types 'string' and 'int' are not equatable", }, { SQLs: sqls( "select d <= b from binoptests_i;", ), - ExpErr: "operator '<=' incompatible with type 'STRING'", + ExpErr: "operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select d >= b from binoptests_i;", ), - ExpErr: "operator '>=' incompatible with type 'STRING'", + ExpErr: "operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select d < b from binoptests_i;", ), - ExpErr: "operator '<' incompatible with type 'STRING'", + ExpErr: "operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select d > b from binoptests_i;", ), - ExpErr: "operator '>' incompatible with type 'STRING'", + ExpErr: "operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select d & b from binoptests_i;", ), - ExpErr: "operator '&' incompatible with type 'STRING'", + ExpErr: "operator '&' incompatible with type 'string'", }, { SQLs: sqls( "select d | b from binoptests_i;", ), - ExpErr: "operator '|' incompatible with type 'STRING'", + ExpErr: "operator '|' incompatible with type 'string'", }, { SQLs: sqls( "select d << b from binoptests_i;", ), - ExpErr: "operator '<<' incompatible with type 'STRING'", + ExpErr: "operator '<<' incompatible with type 'string'", }, { SQLs: sqls( "select d >> b from binoptests_i;", ), - ExpErr: "operator '>>' incompatible with type 'STRING'", + ExpErr: "operator '>>' incompatible with type 'string'", }, { SQLs: sqls( "select d + b from binoptests_i;", ), - ExpErr: "operator '+' incompatible with type 'STRING'", + ExpErr: "operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select d - b from binoptests_i;", ), - ExpErr: "operator '-' incompatible with type 'STRING'", + ExpErr: "operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select d * b from binoptests_i;", ), - ExpErr: "operator '*' incompatible with type 'STRING'", + ExpErr: "operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select d / b from binoptests_i;", ), - ExpErr: "operator '/' incompatible with type 'STRING'", + ExpErr: "operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select d % b from binoptests_i;", ), - ExpErr: "operator '%' incompatible with type 'STRING'", + ExpErr: "operator '%' incompatible with type 'string'", }, { SQLs: sqls( "select d || b from binoptests_i;", ), - ExpErr: "operator '||' incompatible with type 'INT'", + ExpErr: "operator '||' incompatible with type 'int'", }, }, } @@ -6228,97 +6228,97 @@ var binOpExprWithStringBool = TableTest{ SQLs: sqls( "select d != b from binoptests_b;", ), - ExpErr: "types 'STRING' and 'BOOL' are not equatable", + ExpErr: "types 'string' and 'bool' are not equatable", }, { SQLs: sqls( "select d = b from binoptests_b;", ), - ExpErr: "types 'STRING' and 'BOOL' are not equatable", + ExpErr: "types 'string' and 'bool' are not equatable", }, { SQLs: sqls( "select d <= b from binoptests_b;", ), - ExpErr: "operator '<=' incompatible with type 'STRING'", + ExpErr: "operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select d >= b from binoptests_b;", ), - ExpErr: "operator '>=' incompatible with type 'STRING'", + ExpErr: "operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select d < b from binoptests_b;", ), - ExpErr: "operator '<' incompatible with type 'STRING'", + ExpErr: "operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select d > b from binoptests_b;", ), - ExpErr: "operator '>' incompatible with type 'STRING'", + ExpErr: "operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select d & b from binoptests_b;", ), - ExpErr: "operator '&' incompatible with type 'STRING'", + ExpErr: "operator '&' incompatible with type 'string'", }, { SQLs: sqls( "select d | b from binoptests_b;", ), - ExpErr: "operator '|' incompatible with type 'STRING'", + ExpErr: "operator '|' incompatible with type 'string'", }, { SQLs: sqls( "select d << b from binoptests_b;", ), - ExpErr: "operator '<<' incompatible with type 'STRING'", + ExpErr: "operator '<<' incompatible with type 'string'", }, { SQLs: sqls( "select d >> b from binoptests_b;", ), - ExpErr: "operator '>>' incompatible with type 'STRING'", + ExpErr: "operator '>>' incompatible with type 'string'", }, { SQLs: sqls( "select d + b from binoptests_b;", ), - ExpErr: "operator '+' incompatible with type 'STRING'", + ExpErr: "operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select d - b from binoptests_b;", ), - ExpErr: "operator '-' incompatible with type 'STRING'", + ExpErr: "operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select d * b from binoptests_b;", ), - ExpErr: "operator '*' incompatible with type 'STRING'", + ExpErr: "operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select d / b from binoptests_b;", ), - ExpErr: "operator '/' incompatible with type 'STRING'", + ExpErr: "operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select d % b from binoptests_b;", ), - ExpErr: "operator '%' incompatible with type 'STRING'", + ExpErr: "operator '%' incompatible with type 'string'", }, { SQLs: sqls( "select d || b from binoptests_b;", ), - ExpErr: "operator '||' incompatible with type 'BOOL'", + ExpErr: "operator '||' incompatible with type 'bool'", }, }, } @@ -6340,97 +6340,97 @@ var binOpExprWithStringID = TableTest{ SQLs: sqls( "select d != b from binoptests_id;", ), - ExpErr: "types 'STRING' and 'ID' are not equatable", + ExpErr: "types 'string' and 'id' are not equatable", }, { SQLs: sqls( "select d = b from binoptests_id;", ), - ExpErr: "types 'STRING' and 'ID' are not equatable", + ExpErr: "types 'string' and 'id' are not equatable", }, { SQLs: sqls( "select d <= b from binoptests_id;", ), - ExpErr: "operator '<=' incompatible with type 'STRING'", + ExpErr: "operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select d >= b from binoptests_id;", ), - ExpErr: "operator '>=' incompatible with type 'STRING'", + ExpErr: "operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select d < b from binoptests_id;", ), - ExpErr: "operator '<' incompatible with type 'STRING'", + ExpErr: "operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select d > b from binoptests_id;", ), - ExpErr: "operator '>' incompatible with type 'STRING'", + ExpErr: "operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select d & b from binoptests_id;", ), - ExpErr: "operator '&' incompatible with type 'STRING'", + ExpErr: "operator '&' incompatible with type 'string'", }, { SQLs: sqls( "select d | b from binoptests_id;", ), - ExpErr: "operator '|' incompatible with type 'STRING'", + ExpErr: "operator '|' incompatible with type 'string'", }, { SQLs: sqls( "select d << b from binoptests_id;", ), - ExpErr: "operator '<<' incompatible with type 'STRING'", + ExpErr: "operator '<<' incompatible with type 'string'", }, { SQLs: sqls( "select d >> b from binoptests_id;", ), - ExpErr: "operator '>>' incompatible with type 'STRING'", + ExpErr: "operator '>>' incompatible with type 'string'", }, { SQLs: sqls( "select d + b from binoptests_id;", ), - ExpErr: "operator '+' incompatible with type 'STRING'", + ExpErr: "operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select d - b from binoptests_id;", ), - ExpErr: "operator '-' incompatible with type 'STRING'", + ExpErr: "operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select d * b from binoptests_id;", ), - ExpErr: "operator '*' incompatible with type 'STRING'", + ExpErr: "operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select d / b from binoptests_id;", ), - ExpErr: "operator '/' incompatible with type 'STRING'", + ExpErr: "operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select d % b from binoptests_id;", ), - ExpErr: "operator '%' incompatible with type 'STRING'", + ExpErr: "operator '%' incompatible with type 'string'", }, { SQLs: sqls( "select d || b from binoptests_id;", ), - ExpErr: "operator '||' incompatible with type 'ID'", + ExpErr: "operator '||' incompatible with type 'id'", }, }, } @@ -6452,97 +6452,97 @@ var binOpExprWithStringDecimal = TableTest{ SQLs: sqls( "select a != d from binoptests_d;", ), - ExpErr: "types 'STRING' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'string' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a = d from binoptests_d;", ), - ExpErr: "types 'STRING' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'string' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a <= d from binoptests_d;", ), - ExpErr: "operator '<=' incompatible with type 'STRING'", + ExpErr: "operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select a >= d from binoptests_d;", ), - ExpErr: "operator '>=' incompatible with type 'STRING'", + ExpErr: "operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select a < d from binoptests_d;", ), - ExpErr: "operator '<' incompatible with type 'STRING'", + ExpErr: "operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select a > d from binoptests_d;", ), - ExpErr: "operator '>' incompatible with type 'STRING'", + ExpErr: "operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select a & d from binoptests_d;", ), - ExpErr: "operator '&' incompatible with type 'STRING'", + ExpErr: "operator '&' incompatible with type 'string'", }, { SQLs: sqls( "select a | d from binoptests_d;", ), - ExpErr: "operator '|' incompatible with type 'STRING'", + ExpErr: "operator '|' incompatible with type 'string'", }, { SQLs: sqls( "select a << d from binoptests_d;", ), - ExpErr: "operator '<<' incompatible with type 'STRING'", + ExpErr: "operator '<<' incompatible with type 'string'", }, { SQLs: sqls( "select a >> d from binoptests_d;", ), - ExpErr: "operator '>>' incompatible with type 'STRING'", + ExpErr: "operator '>>' incompatible with type 'string'", }, { SQLs: sqls( "select a + d from binoptests_d;", ), - ExpErr: "operator '+' incompatible with type 'STRING'", + ExpErr: "operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select a - d from binoptests_d;", ), - ExpErr: "operator '-' incompatible with type 'STRING'", + ExpErr: "operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select a * d from binoptests_d;", ), - ExpErr: "operator '*' incompatible with type 'STRING'", + ExpErr: "operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select a / d from binoptests_d;", ), - ExpErr: "operator '/' incompatible with type 'STRING'", + ExpErr: "operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select a % d from binoptests_d;", ), - ExpErr: "operator '%' incompatible with type 'STRING'", + ExpErr: "operator '%' incompatible with type 'string'", }, { SQLs: sqls( "select a || d from binoptests_d;", ), - ExpErr: "operator '||' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '||' incompatible with type 'decimal(2)'", }, }, } @@ -6564,97 +6564,97 @@ var binOpExprWithStringTimestamp = TableTest{ SQLs: sqls( "select a != ts from binoptests_ts;", ), - ExpErr: "types 'STRING' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'string' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a = ts from binoptests_ts;", ), - ExpErr: "types 'STRING' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'string' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a <= ts from binoptests_ts;", ), - ExpErr: " operator '<=' incompatible with type 'STRING'", + ExpErr: " operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select a >= ts from binoptests_ts;", ), - ExpErr: " operator '>=' incompatible with type 'STRING'", + ExpErr: " operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select a < ts from binoptests_ts;", ), - ExpErr: " operator '<' incompatible with type 'STRING'", + ExpErr: " operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select a > ts from binoptests_ts;", ), - ExpErr: " operator '>' incompatible with type 'STRING'", + ExpErr: " operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select a & ts from binoptests_ts;", ), - ExpErr: "operator '&' incompatible with type 'STRING'", + ExpErr: "operator '&' incompatible with type 'string'", }, { SQLs: sqls( "select a | ts from binoptests_ts;", ), - ExpErr: "operator '|' incompatible with type 'STRING'", + ExpErr: "operator '|' incompatible with type 'string'", }, { SQLs: sqls( "select a << ts from binoptests_ts;", ), - ExpErr: "operator '<<' incompatible with type 'STRING'", + ExpErr: "operator '<<' incompatible with type 'string'", }, { SQLs: sqls( "select a >> ts from binoptests_ts;", ), - ExpErr: "operator '>>' incompatible with type 'STRING'", + ExpErr: "operator '>>' incompatible with type 'string'", }, { SQLs: sqls( "select a + ts from binoptests_ts;", ), - ExpErr: "operator '+' incompatible with type 'STRING'", + ExpErr: "operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select a - ts from binoptests_ts;", ), - ExpErr: "operator '-' incompatible with type 'STRING'", + ExpErr: "operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select a * ts from binoptests_ts;", ), - ExpErr: "operator '*' incompatible with type 'STRING'", + ExpErr: "operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select a / ts from binoptests_ts;", ), - ExpErr: "operator '/' incompatible with type 'STRING'", + ExpErr: "operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select a % ts from binoptests_ts;", ), - ExpErr: "operator '%' incompatible with type 'STRING'", + ExpErr: "operator '%' incompatible with type 'string'", }, { SQLs: sqls( "select a || ts from binoptests_ts;", ), - ExpErr: "operator '||' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '||' incompatible with type 'timestamp'", }, }, } @@ -6676,97 +6676,97 @@ var binOpExprWithStringIDSet = TableTest{ SQLs: sqls( "select a != b from binoptests_ids;", ), - ExpErr: "types 'STRING' and 'IDSET' are not equatable", + ExpErr: "types 'string' and 'idset' are not equatable", }, { SQLs: sqls( "select a = b from binoptests_ids;", ), - ExpErr: "types 'STRING' and 'IDSET' are not equatable", + ExpErr: "types 'string' and 'idset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptests_ids;", ), - ExpErr: " operator '<=' incompatible with type 'STRING'", + ExpErr: " operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select a >= b from binoptests_ids;", ), - ExpErr: " operator '>=' incompatible with type 'STRING'", + ExpErr: " operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select a < b from binoptests_ids;", ), - ExpErr: " operator '<' incompatible with type 'STRING'", + ExpErr: " operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select a > b from binoptests_ids;", ), - ExpErr: " operator '>' incompatible with type 'STRING'", + ExpErr: " operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select a & b from binoptests_ids;", ), - ExpErr: " operator '&' incompatible with type 'STRING'", + ExpErr: " operator '&' incompatible with type 'string'", }, { SQLs: sqls( "select a | b from binoptests_ids;", ), - ExpErr: " operator '|' incompatible with type 'STRING'", + ExpErr: " operator '|' incompatible with type 'string'", }, { SQLs: sqls( "select a << b from binoptests_ids;", ), - ExpErr: " operator '<<' incompatible with type 'STRING'", + ExpErr: " operator '<<' incompatible with type 'string'", }, { SQLs: sqls( "select a >> b from binoptests_ids;", ), - ExpErr: " operator '>>' incompatible with type 'STRING'", + ExpErr: " operator '>>' incompatible with type 'string'", }, { SQLs: sqls( "select a + b from binoptests_ids;", ), - ExpErr: " operator '+' incompatible with type 'STRING'", + ExpErr: " operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select a - b from binoptests_ids;", ), - ExpErr: " operator '-' incompatible with type 'STRING'", + ExpErr: " operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select a * b from binoptests_ids;", ), - ExpErr: " operator '*' incompatible with type 'STRING'", + ExpErr: " operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select a / b from binoptests_ids;", ), - ExpErr: " operator '/' incompatible with type 'STRING'", + ExpErr: " operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select a % b from binoptests_ids;", ), - ExpErr: " operator '%' incompatible with type 'STRING'", + ExpErr: " operator '%' incompatible with type 'string'", }, { SQLs: sqls( "select a || b from binoptests_ids;", ), - ExpErr: "operator '||' incompatible with type 'IDSET'", + ExpErr: "operator '||' incompatible with type 'idset'", }, }, } @@ -6812,79 +6812,79 @@ var binOpExprWithStringString = TableTest{ SQLs: sqls( "select a <= b from binoptests_s;", ), - ExpErr: " operator '<=' incompatible with type 'STRING'", + ExpErr: " operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select a >= b from binoptests_s;", ), - ExpErr: " operator '>=' incompatible with type 'STRING'", + ExpErr: " operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select a < b from binoptests_s;", ), - ExpErr: " operator '<' incompatible with type 'STRING'", + ExpErr: " operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select a > b from binoptests_s;", ), - ExpErr: " operator '>' incompatible with type 'STRING'", + ExpErr: " operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select a & b from binoptests_s;", ), - ExpErr: " operator '&' incompatible with type 'STRING'", + ExpErr: " operator '&' incompatible with type 'string'", }, { SQLs: sqls( "select a | b from binoptests_s;", ), - ExpErr: " operator '|' incompatible with type 'STRING'", + ExpErr: " operator '|' incompatible with type 'string'", }, { SQLs: sqls( "select a << b from binoptests_s;", ), - ExpErr: " operator '<<' incompatible with type 'STRING'", + ExpErr: " operator '<<' incompatible with type 'string'", }, { SQLs: sqls( "select a >> b from binoptests_s;", ), - ExpErr: " operator '>>' incompatible with type 'STRING'", + ExpErr: " operator '>>' incompatible with type 'string'", }, { SQLs: sqls( "select a + b from binoptests_s;", ), - ExpErr: " operator '+' incompatible with type 'STRING'", + ExpErr: " operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select a - b from binoptests_s;", ), - ExpErr: " operator '-' incompatible with type 'STRING'", + ExpErr: " operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select a * b from binoptests_s;", ), - ExpErr: " operator '*' incompatible with type 'STRING'", + ExpErr: " operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select a / b from binoptests_s;", ), - ExpErr: " operator '/' incompatible with type 'STRING'", + ExpErr: " operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select a % b from binoptests_s;", ), - ExpErr: " operator '%' incompatible with type 'STRING'", + ExpErr: " operator '%' incompatible with type 'string'", }, { SQLs: sqls( @@ -6918,97 +6918,97 @@ var binOpExprWithStringStringSet = TableTest{ SQLs: sqls( "select a != b from binoptests_ss;", ), - ExpErr: "types 'STRING' and 'STRINGSET' are not equatable", + ExpErr: "types 'string' and 'stringset' are not equatable", }, { SQLs: sqls( "select a = b from binoptests_ss;", ), - ExpErr: "types 'STRING' and 'STRINGSET' are not equatable", + ExpErr: "types 'string' and 'stringset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptests_ss;", ), - ExpErr: " operator '<=' incompatible with type 'STRING'", + ExpErr: " operator '<=' incompatible with type 'string'", }, { SQLs: sqls( "select a >= b from binoptests_ss;", ), - ExpErr: " operator '>=' incompatible with type 'STRING'", + ExpErr: " operator '>=' incompatible with type 'string'", }, { SQLs: sqls( "select a < b from binoptests_ss;", ), - ExpErr: " operator '<' incompatible with type 'STRING'", + ExpErr: " operator '<' incompatible with type 'string'", }, { SQLs: sqls( "select a > b from binoptests_ss;", ), - ExpErr: " operator '>' incompatible with type 'STRING'", + ExpErr: " operator '>' incompatible with type 'string'", }, { SQLs: sqls( "select a & b from binoptests_ss;", ), - ExpErr: " operator '&' incompatible with type 'STRING'", + ExpErr: " operator '&' incompatible with type 'string'", }, { SQLs: sqls( "select a | b from binoptests_ss;", ), - ExpErr: " operator '|' incompatible with type 'STRING'", + ExpErr: " operator '|' incompatible with type 'string'", }, { SQLs: sqls( "select a << b from binoptests_ss;", ), - ExpErr: " operator '<<' incompatible with type 'STRING'", + ExpErr: " operator '<<' incompatible with type 'string'", }, { SQLs: sqls( "select a >> b from binoptests_ss;", ), - ExpErr: " operator '>>' incompatible with type 'STRING'", + ExpErr: " operator '>>' incompatible with type 'string'", }, { SQLs: sqls( "select a + b from binoptests_ss;", ), - ExpErr: " operator '+' incompatible with type 'STRING'", + ExpErr: " operator '+' incompatible with type 'string'", }, { SQLs: sqls( "select a - b from binoptests_ss;", ), - ExpErr: " operator '-' incompatible with type 'STRING'", + ExpErr: " operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select a * b from binoptests_ss;", ), - ExpErr: " operator '*' incompatible with type 'STRING'", + ExpErr: " operator '*' incompatible with type 'string'", }, { SQLs: sqls( "select a / b from binoptests_ss;", ), - ExpErr: " operator '/' incompatible with type 'STRING'", + ExpErr: " operator '/' incompatible with type 'string'", }, { SQLs: sqls( "select a % b from binoptests_ss;", ), - ExpErr: " operator '%' incompatible with type 'STRING'", + ExpErr: " operator '%' incompatible with type 'string'", }, { SQLs: sqls( "select a || b from binoptests_ss;", ), - ExpErr: "operator '||' incompatible with type 'STRINGSET'", + ExpErr: "operator '||' incompatible with type 'stringset'", }, }, } @@ -7031,97 +7031,97 @@ var binOpExprWithStringSetInt = TableTest{ SQLs: sqls( "select d != b from binoptestss_i;", ), - ExpErr: "types 'STRINGSET' and 'INT' are not equatable", + ExpErr: "types 'stringset' and 'int' are not equatable", }, { SQLs: sqls( "select d = b from binoptestss_i;", ), - ExpErr: "types 'STRINGSET' and 'INT' are not equatable", + ExpErr: "types 'stringset' and 'int' are not equatable", }, { SQLs: sqls( "select d <= b from binoptestss_i;", ), - ExpErr: "operator '<=' incompatible with type 'STRINGSET'", + ExpErr: "operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select d >= b from binoptestss_i;", ), - ExpErr: "operator '>=' incompatible with type 'STRINGSET'", + ExpErr: "operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select d < b from binoptestss_i;", ), - ExpErr: "operator '<' incompatible with type 'STRINGSET'", + ExpErr: "operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select d > b from binoptestss_i;", ), - ExpErr: "operator '>' incompatible with type 'STRINGSET'", + ExpErr: "operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select d & b from binoptestss_i;", ), - ExpErr: "operator '&' incompatible with type 'STRINGSET'", + ExpErr: "operator '&' incompatible with type 'stringset'", }, { SQLs: sqls( "select d | b from binoptestss_i;", ), - ExpErr: "operator '|' incompatible with type 'STRINGSET'", + ExpErr: "operator '|' incompatible with type 'stringset'", }, { SQLs: sqls( "select d << b from binoptestss_i;", ), - ExpErr: "operator '<<' incompatible with type 'STRINGSET'", + ExpErr: "operator '<<' incompatible with type 'stringset'", }, { SQLs: sqls( "select d >> b from binoptestss_i;", ), - ExpErr: "operator '>>' incompatible with type 'STRINGSET'", + ExpErr: "operator '>>' incompatible with type 'stringset'", }, { SQLs: sqls( "select d + b from binoptestss_i;", ), - ExpErr: "operator '+' incompatible with type 'STRINGSET'", + ExpErr: "operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select d - b from binoptestss_i;", ), - ExpErr: "operator '-' incompatible with type 'STRINGSET'", + ExpErr: "operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select d * b from binoptestss_i;", ), - ExpErr: "operator '*' incompatible with type 'STRINGSET'", + ExpErr: "operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select d / b from binoptestss_i;", ), - ExpErr: "operator '/' incompatible with type 'STRINGSET'", + ExpErr: "operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select d % b from binoptestss_i;", ), - ExpErr: "operator '%' incompatible with type 'STRINGSET'", + ExpErr: "operator '%' incompatible with type 'stringset'", }, { SQLs: sqls( "select d || b from binoptestss_i;", ), - ExpErr: "operator '||' incompatible with type 'STRINGSET'", + ExpErr: "operator '||' incompatible with type 'stringset'", }, }, } @@ -7143,97 +7143,97 @@ var binOpExprWithStringSetBool = TableTest{ SQLs: sqls( "select d != b from binoptestss_b;", ), - ExpErr: "types 'STRINGSET' and 'BOOL' are not equatable", + ExpErr: "types 'stringset' and 'bool' are not equatable", }, { SQLs: sqls( "select d = b from binoptestss_b;", ), - ExpErr: "types 'STRINGSET' and 'BOOL' are not equatable", + ExpErr: "types 'stringset' and 'bool' are not equatable", }, { SQLs: sqls( "select d <= b from binoptestss_b;", ), - ExpErr: "operator '<=' incompatible with type 'STRINGSET'", + ExpErr: "operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select d >= b from binoptestss_b;", ), - ExpErr: "operator '>=' incompatible with type 'STRINGSET'", + ExpErr: "operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select d < b from binoptestss_b;", ), - ExpErr: "operator '<' incompatible with type 'STRINGSET'", + ExpErr: "operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select d > b from binoptestss_b;", ), - ExpErr: "operator '>' incompatible with type 'STRINGSET'", + ExpErr: "operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select d & b from binoptestss_b;", ), - ExpErr: "operator '&' incompatible with type 'STRINGSET'", + ExpErr: "operator '&' incompatible with type 'stringset'", }, { SQLs: sqls( "select d | b from binoptestss_b;", ), - ExpErr: "operator '|' incompatible with type 'STRINGSET'", + ExpErr: "operator '|' incompatible with type 'stringset'", }, { SQLs: sqls( "select d << b from binoptestss_b;", ), - ExpErr: "operator '<<' incompatible with type 'STRINGSET'", + ExpErr: "operator '<<' incompatible with type 'stringset'", }, { SQLs: sqls( "select d >> b from binoptestss_b;", ), - ExpErr: "operator '>>' incompatible with type 'STRINGSET'", + ExpErr: "operator '>>' incompatible with type 'stringset'", }, { SQLs: sqls( "select d + b from binoptestss_b;", ), - ExpErr: "operator '+' incompatible with type 'STRINGSET'", + ExpErr: "operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select d - b from binoptestss_b;", ), - ExpErr: "operator '-' incompatible with type 'STRINGSET'", + ExpErr: "operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select d * b from binoptestss_b;", ), - ExpErr: "operator '*' incompatible with type 'STRINGSET'", + ExpErr: "operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select d / b from binoptestss_b;", ), - ExpErr: "operator '/' incompatible with type 'STRINGSET'", + ExpErr: "operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select d % b from binoptestss_b;", ), - ExpErr: "operator '%' incompatible with type 'STRINGSET'", + ExpErr: "operator '%' incompatible with type 'stringset'", }, { SQLs: sqls( "select d || b from binoptestss_b;", ), - ExpErr: "operator '||' incompatible with type 'STRINGSET'", + ExpErr: "operator '||' incompatible with type 'stringset'", }, }, } @@ -7255,97 +7255,97 @@ var binOpExprWithStringSetID = TableTest{ SQLs: sqls( "select d != b from binoptestss_id;", ), - ExpErr: "types 'STRINGSET' and 'ID' are not equatable", + ExpErr: "types 'stringset' and 'id' are not equatable", }, { SQLs: sqls( "select d = b from binoptestss_id;", ), - ExpErr: "types 'STRINGSET' and 'ID' are not equatable", + ExpErr: "types 'stringset' and 'id' are not equatable", }, { SQLs: sqls( "select d <= b from binoptestss_id;", ), - ExpErr: "operator '<=' incompatible with type 'STRINGSET'", + ExpErr: "operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select d >= b from binoptestss_id;", ), - ExpErr: "operator '>=' incompatible with type 'STRINGSET'", + ExpErr: "operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select d < b from binoptestss_id;", ), - ExpErr: "operator '<' incompatible with type 'STRINGSET'", + ExpErr: "operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select d > b from binoptestss_id;", ), - ExpErr: "operator '>' incompatible with type 'STRINGSET'", + ExpErr: "operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select d & b from binoptestss_id;", ), - ExpErr: "operator '&' incompatible with type 'STRINGSET'", + ExpErr: "operator '&' incompatible with type 'stringset'", }, { SQLs: sqls( "select d | b from binoptestss_id;", ), - ExpErr: "operator '|' incompatible with type 'STRINGSET'", + ExpErr: "operator '|' incompatible with type 'stringset'", }, { SQLs: sqls( "select d << b from binoptestss_id;", ), - ExpErr: "operator '<<' incompatible with type 'STRINGSET'", + ExpErr: "operator '<<' incompatible with type 'stringset'", }, { SQLs: sqls( "select d >> b from binoptestss_id;", ), - ExpErr: "operator '>>' incompatible with type 'STRINGSET'", + ExpErr: "operator '>>' incompatible with type 'stringset'", }, { SQLs: sqls( "select d + b from binoptestss_id;", ), - ExpErr: "operator '+' incompatible with type 'STRINGSET'", + ExpErr: "operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select d - b from binoptestss_id;", ), - ExpErr: "operator '-' incompatible with type 'STRINGSET'", + ExpErr: "operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select d * b from binoptestss_id;", ), - ExpErr: "operator '*' incompatible with type 'STRINGSET'", + ExpErr: "operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select d / b from binoptestss_id;", ), - ExpErr: "operator '/' incompatible with type 'STRINGSET'", + ExpErr: "operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select d % b from binoptestss_id;", ), - ExpErr: "operator '%' incompatible with type 'STRINGSET'", + ExpErr: "operator '%' incompatible with type 'stringset'", }, { SQLs: sqls( "select d || b from binoptestss_id;", ), - ExpErr: "operator '||' incompatible with type 'STRINGSET'", + ExpErr: "operator '||' incompatible with type 'stringset'", }, }, } @@ -7367,97 +7367,97 @@ var binOpExprWithStringSetDecimal = TableTest{ SQLs: sqls( "select a != d from binoptestss_d;", ), - ExpErr: "types 'STRINGSET' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'stringset' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a = d from binoptestss_d;", ), - ExpErr: "types 'STRINGSET' and 'DECIMAL(2)' are not equatable", + ExpErr: "types 'stringset' and 'decimal(2)' are not equatable", }, { SQLs: sqls( "select a <= d from binoptestss_d;", ), - ExpErr: "operator '<=' incompatible with type 'STRINGSET'", + ExpErr: "operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >= d from binoptestss_d;", ), - ExpErr: "operator '>=' incompatible with type 'STRINGSET'", + ExpErr: "operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a < d from binoptestss_d;", ), - ExpErr: "operator '<' incompatible with type 'STRINGSET'", + ExpErr: "operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a > d from binoptestss_d;", ), - ExpErr: "operator '>' incompatible with type 'STRINGSET'", + ExpErr: "operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a & d from binoptestss_d;", ), - ExpErr: "operator '&' incompatible with type 'STRINGSET'", + ExpErr: "operator '&' incompatible with type 'stringset'", }, { SQLs: sqls( "select a | d from binoptestss_d;", ), - ExpErr: "operator '|' incompatible with type 'STRINGSET'", + ExpErr: "operator '|' incompatible with type 'stringset'", }, { SQLs: sqls( "select a << d from binoptestss_d;", ), - ExpErr: "operator '<<' incompatible with type 'STRINGSET'", + ExpErr: "operator '<<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >> d from binoptestss_d;", ), - ExpErr: "operator '>>' incompatible with type 'STRINGSET'", + ExpErr: "operator '>>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a + d from binoptestss_d;", ), - ExpErr: "operator '+' incompatible with type 'STRINGSET'", + ExpErr: "operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select a - d from binoptestss_d;", ), - ExpErr: "operator '-' incompatible with type 'STRINGSET'", + ExpErr: "operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select a * d from binoptestss_d;", ), - ExpErr: "operator '*' incompatible with type 'STRINGSET'", + ExpErr: "operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select a / d from binoptestss_d;", ), - ExpErr: "operator '/' incompatible with type 'STRINGSET'", + ExpErr: "operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select a % d from binoptestss_d;", ), - ExpErr: "operator '%' incompatible with type 'STRINGSET'", + ExpErr: "operator '%' incompatible with type 'stringset'", }, { SQLs: sqls( "select a || d from binoptestss_d;", ), - ExpErr: "operator '||' incompatible with type 'STRINGSET'", + ExpErr: "operator '||' incompatible with type 'stringset'", }, }, } @@ -7479,97 +7479,97 @@ var binOpExprWithStringSetTimestamp = TableTest{ SQLs: sqls( "select a != ts from binoptestss_ts;", ), - ExpErr: "types 'STRINGSET' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'stringset' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a = ts from binoptestss_ts;", ), - ExpErr: "types 'STRINGSET' and 'TIMESTAMP' are not equatable", + ExpErr: "types 'stringset' and 'timestamp' are not equatable", }, { SQLs: sqls( "select a <= ts from binoptestss_ts;", ), - ExpErr: " operator '<=' incompatible with type 'STRINGSET'", + ExpErr: " operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >= ts from binoptestss_ts;", ), - ExpErr: " operator '>=' incompatible with type 'STRINGSET'", + ExpErr: " operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a < ts from binoptestss_ts;", ), - ExpErr: " operator '<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a > ts from binoptestss_ts;", ), - ExpErr: " operator '>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a & ts from binoptestss_ts;", ), - ExpErr: "operator '&' incompatible with type 'STRINGSET'", + ExpErr: "operator '&' incompatible with type 'stringset'", }, { SQLs: sqls( "select a | ts from binoptestss_ts;", ), - ExpErr: "operator '|' incompatible with type 'STRINGSET'", + ExpErr: "operator '|' incompatible with type 'stringset'", }, { SQLs: sqls( "select a << ts from binoptestss_ts;", ), - ExpErr: "operator '<<' incompatible with type 'STRINGSET'", + ExpErr: "operator '<<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >> ts from binoptestss_ts;", ), - ExpErr: "operator '>>' incompatible with type 'STRINGSET'", + ExpErr: "operator '>>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a + ts from binoptestss_ts;", ), - ExpErr: "operator '+' incompatible with type 'STRINGSET'", + ExpErr: "operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select a - ts from binoptestss_ts;", ), - ExpErr: "operator '-' incompatible with type 'STRINGSET'", + ExpErr: "operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select a * ts from binoptestss_ts;", ), - ExpErr: "operator '*' incompatible with type 'STRINGSET'", + ExpErr: "operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select a / ts from binoptestss_ts;", ), - ExpErr: "operator '/' incompatible with type 'STRINGSET'", + ExpErr: "operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select a % ts from binoptestss_ts;", ), - ExpErr: "operator '%' incompatible with type 'STRINGSET'", + ExpErr: "operator '%' incompatible with type 'stringset'", }, { SQLs: sqls( "select a || ts from binoptestss_ts;", ), - ExpErr: "operator '||' incompatible with type 'STRINGSET'", + ExpErr: "operator '||' incompatible with type 'stringset'", }, }, } @@ -7591,97 +7591,97 @@ var binOpExprWithStringSetIDSet = TableTest{ SQLs: sqls( "select a != b from binoptestss_ids;", ), - ExpErr: "types 'STRINGSET' and 'IDSET' are not equatable", + ExpErr: "types 'stringset' and 'idset' are not equatable", }, { SQLs: sqls( "select a = b from binoptestss_ids;", ), - ExpErr: "types 'STRINGSET' and 'IDSET' are not equatable", + ExpErr: "types 'stringset' and 'idset' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestss_ids;", ), - ExpErr: " operator '<=' incompatible with type 'STRINGSET'", + ExpErr: " operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >= b from binoptestss_ids;", ), - ExpErr: " operator '>=' incompatible with type 'STRINGSET'", + ExpErr: " operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a < b from binoptestss_ids;", ), - ExpErr: " operator '<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a > b from binoptestss_ids;", ), - ExpErr: " operator '>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a & b from binoptestss_ids;", ), - ExpErr: " operator '&' incompatible with type 'STRINGSET'", + ExpErr: " operator '&' incompatible with type 'stringset'", }, { SQLs: sqls( "select a | b from binoptestss_ids;", ), - ExpErr: " operator '|' incompatible with type 'STRINGSET'", + ExpErr: " operator '|' incompatible with type 'stringset'", }, { SQLs: sqls( "select a << b from binoptestss_ids;", ), - ExpErr: " operator '<<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >> b from binoptestss_ids;", ), - ExpErr: " operator '>>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a + b from binoptestss_ids;", ), - ExpErr: " operator '+' incompatible with type 'STRINGSET'", + ExpErr: " operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select a - b from binoptestss_ids;", ), - ExpErr: " operator '-' incompatible with type 'STRINGSET'", + ExpErr: " operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select a * b from binoptestss_ids;", ), - ExpErr: " operator '*' incompatible with type 'STRINGSET'", + ExpErr: " operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select a / b from binoptestss_ids;", ), - ExpErr: " operator '/' incompatible with type 'STRINGSET'", + ExpErr: " operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select a % b from binoptestss_ids;", ), - ExpErr: " operator '%' incompatible with type 'STRINGSET'", + ExpErr: " operator '%' incompatible with type 'stringset'", }, { SQLs: sqls( "select a || b from binoptestss_ids;", ), - ExpErr: "operator '||' incompatible with type 'STRINGSET'", + ExpErr: "operator '||' incompatible with type 'stringset'", }, }, } @@ -7703,97 +7703,97 @@ var binOpExprWithStringSetString = TableTest{ SQLs: sqls( "select a != b from binoptestss_s;", ), - ExpErr: "types 'STRINGSET' and 'STRING' are not equatable", + ExpErr: "types 'stringset' and 'string' are not equatable", }, { SQLs: sqls( "select a = b from binoptestss_s;", ), - ExpErr: "types 'STRINGSET' and 'STRING' are not equatable", + ExpErr: "types 'stringset' and 'string' are not equatable", }, { SQLs: sqls( "select a <= b from binoptestss_s;", ), - ExpErr: " operator '<=' incompatible with type 'STRINGSET'", + ExpErr: " operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >= b from binoptestss_s;", ), - ExpErr: " operator '>=' incompatible with type 'STRINGSET'", + ExpErr: " operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a < b from binoptestss_s;", ), - ExpErr: " operator '<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a > b from binoptestss_s;", ), - ExpErr: " operator '>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a & b from binoptestss_s;", ), - ExpErr: " operator '&' incompatible with type 'STRINGSET'", + ExpErr: " operator '&' incompatible with type 'stringset'", }, { SQLs: sqls( "select a | b from binoptestss_s;", ), - ExpErr: " operator '|' incompatible with type 'STRINGSET'", + ExpErr: " operator '|' incompatible with type 'stringset'", }, { SQLs: sqls( "select a << b from binoptestss_s;", ), - ExpErr: " operator '<<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >> b from binoptestss_s;", ), - ExpErr: " operator '>>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a + b from binoptestss_s;", ), - ExpErr: " operator '+' incompatible with type 'STRINGSET'", + ExpErr: " operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select a - b from binoptestss_s;", ), - ExpErr: " operator '-' incompatible with type 'STRINGSET'", + ExpErr: " operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select a * b from binoptestss_s;", ), - ExpErr: " operator '*' incompatible with type 'STRINGSET'", + ExpErr: " operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select a / b from binoptestss_s;", ), - ExpErr: " operator '/' incompatible with type 'STRINGSET'", + ExpErr: " operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select a % b from binoptestss_s;", ), - ExpErr: " operator '%' incompatible with type 'STRINGSET'", + ExpErr: " operator '%' incompatible with type 'stringset'", }, { SQLs: sqls( "select a || b from binoptestss_s;", ), - ExpErr: "operator '||' incompatible with type 'STRINGSET'", + ExpErr: "operator '||' incompatible with type 'stringset'", }, }, } @@ -7839,85 +7839,85 @@ var binOpExprWithStringSetStringSet = TableTest{ SQLs: sqls( "select a <= b from binoptestss_ss;", ), - ExpErr: " operator '<=' incompatible with type 'STRINGSET'", + ExpErr: " operator '<=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >= b from binoptestss_ss;", ), - ExpErr: " operator '>=' incompatible with type 'STRINGSET'", + ExpErr: " operator '>=' incompatible with type 'stringset'", }, { SQLs: sqls( "select a < b from binoptestss_ss;", ), - ExpErr: " operator '<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a > b from binoptestss_ss;", ), - ExpErr: " operator '>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a & b from binoptestss_ss;", ), - ExpErr: " operator '&' incompatible with type 'STRINGSET'", + ExpErr: " operator '&' incompatible with type 'stringset'", }, { SQLs: sqls( "select a | b from binoptestss_ss;", ), - ExpErr: " operator '|' incompatible with type 'STRINGSET'", + ExpErr: " operator '|' incompatible with type 'stringset'", }, { SQLs: sqls( "select a << b from binoptestss_ss;", ), - ExpErr: " operator '<<' incompatible with type 'STRINGSET'", + ExpErr: " operator '<<' incompatible with type 'stringset'", }, { SQLs: sqls( "select a >> b from binoptestss_ss;", ), - ExpErr: " operator '>>' incompatible with type 'STRINGSET'", + ExpErr: " operator '>>' incompatible with type 'stringset'", }, { SQLs: sqls( "select a + b from binoptestss_ss;", ), - ExpErr: " operator '+' incompatible with type 'STRINGSET'", + ExpErr: " operator '+' incompatible with type 'stringset'", }, { SQLs: sqls( "select a - b from binoptestss_ss;", ), - ExpErr: " operator '-' incompatible with type 'STRINGSET'", + ExpErr: " operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select a * b from binoptestss_ss;", ), - ExpErr: " operator '*' incompatible with type 'STRINGSET'", + ExpErr: " operator '*' incompatible with type 'stringset'", }, { SQLs: sqls( "select a / b from binoptestss_ss;", ), - ExpErr: " operator '/' incompatible with type 'STRINGSET'", + ExpErr: " operator '/' incompatible with type 'stringset'", }, { SQLs: sqls( "select a % b from binoptestss_ss;", ), - ExpErr: " operator '%' incompatible with type 'STRINGSET'", + ExpErr: " operator '%' incompatible with type 'stringset'", }, { SQLs: sqls( "select a || b from binoptestss_ss;", ), - ExpErr: "operator '||' incompatible with type 'STRINGSET'", + ExpErr: "operator '||' incompatible with type 'stringset'", }, }, } diff --git a/sql3/test/defs/defs_cast.go b/sql3/test/defs/defs_cast.go index d44d3aa4a..222fc1b1f 100644 --- a/sql3/test/defs/defs_cast.go +++ b/sql3/test/defs/defs_cast.go @@ -81,7 +81,7 @@ var castIntLiteral = TableTest{ SQLs: sqls( "select cast(1 as idset)", ), - ExpErr: "'INT' cannot be cast to 'IDSET'", + ExpErr: "'int' cannot be cast to 'idset'", }, { SQLs: sqls( @@ -99,7 +99,7 @@ var castIntLiteral = TableTest{ SQLs: sqls( "select cast(1 as stringset)", ), - ExpErr: "'INT' cannot be cast to 'STRINGSET'", + ExpErr: "'int' cannot be cast to 'stringset'", }, { SQLs: sqls( @@ -191,7 +191,7 @@ var castInt = TableTest{ SQLs: sqls( "select _id, cast(i1 as idset) from cast_int", ), - ExpErr: "'INT' cannot be cast to 'IDSET'", + ExpErr: "'int' cannot be cast to 'idset'", }, { SQLs: sqls( @@ -210,7 +210,7 @@ var castInt = TableTest{ SQLs: sqls( "select _id, cast(i1 as stringset) from cast_int", ), - ExpErr: "'INT' cannot be cast to 'STRINGSET'", + ExpErr: "'int' cannot be cast to 'stringset'", }, { SQLs: sqls( @@ -277,19 +277,19 @@ var castBool = TableTest{ SQLs: sqls( "select _id, cast(b1 as decimal(2)) from cast_bool", ), - ExpErr: "'BOOL' cannot be cast to 'DECIMAL(2)'", + ExpErr: "'bool' cannot be cast to 'decimal(2)'", }, { SQLs: sqls( "select _id, cast(b1 as id) from cast_bool", ), - ExpErr: "'BOOL' cannot be cast to 'ID'", + ExpErr: "'bool' cannot be cast to 'id'", }, { SQLs: sqls( "select _id, cast(b1 as idset) from cast_bool", ), - ExpErr: "'BOOL' cannot be cast to 'IDSET'", + ExpErr: "'bool' cannot be cast to 'idset'", }, { SQLs: sqls( @@ -308,13 +308,13 @@ var castBool = TableTest{ SQLs: sqls( "select _id, cast(b1 as stringset) from cast_bool", ), - ExpErr: "'BOOL' cannot be cast to 'STRINGSET'", + ExpErr: "'bool' cannot be cast to 'stringset'", }, { SQLs: sqls( "select _id, cast(b1 as timestamp) from cast_bool", ), - ExpErr: "'BOOL' cannot be cast to 'TIMESTAMP'", + ExpErr: "'bool' cannot be cast to 'timestamp'", }, }, } @@ -342,13 +342,13 @@ var castDecimal = TableTest{ SQLs: sqls( "select _id, cast(d1 as int) from cast_dec", ), - ExpErr: "'DECIMAL(2)' cannot be cast to 'INT'", + ExpErr: "'decimal(2)' cannot be cast to 'int'", }, { SQLs: sqls( "select _id, cast(d1 as bool) from cast_dec", ), - ExpErr: "'DECIMAL(2)' cannot be cast to 'BOOL'", + ExpErr: "'decimal(2)' cannot be cast to 'bool'", }, { SQLs: sqls( @@ -367,13 +367,13 @@ var castDecimal = TableTest{ SQLs: sqls( "select _id, cast(d1 as id) from cast_dec", ), - ExpErr: "'DECIMAL(2)' cannot be cast to 'ID'", + ExpErr: "'decimal(2)' cannot be cast to 'id'", }, { SQLs: sqls( "select _id, cast(d1 as idset) from cast_dec", ), - ExpErr: "'DECIMAL(2)' cannot be cast to 'IDSET'", + ExpErr: "'decimal(2)' cannot be cast to 'idset'", }, { SQLs: sqls( @@ -392,13 +392,13 @@ var castDecimal = TableTest{ SQLs: sqls( "select _id, cast(d1 as stringset) from cast_dec", ), - ExpErr: "'DECIMAL(2)' cannot be cast to 'STRINGSET'", + ExpErr: "'decimal(2)' cannot be cast to 'stringset'", }, { SQLs: sqls( "select _id, cast(d1 as timestamp) from cast_dec", ), - ExpErr: "'DECIMAL(2)' cannot be cast to 'TIMESTAMP'", + ExpErr: "'decimal(2)' cannot be cast to 'timestamp'", }, }, } @@ -478,25 +478,25 @@ var castID = TableTest{ SQLs: sqls( "select _id, cast(id1 as idset) from cast_id", ), - ExpErr: "'ID' cannot be cast to 'IDSET'", + ExpErr: "'id' cannot be cast to 'idset'", }, { SQLs: sqls( "select _id, cast(id1 as string) from cast_id", ), - ExpErr: "'ID' cannot be cast to 'STRING'", + ExpErr: "'id' cannot be cast to 'string'", }, { SQLs: sqls( "select _id, cast(id1 as stringset) from cast_id", ), - ExpErr: "'ID' cannot be cast to 'STRINGSET'", + ExpErr: "'id' cannot be cast to 'stringset'", }, { SQLs: sqls( "select _id, cast(id1 as timestamp) from cast_id", ), - ExpErr: "'ID' cannot be cast to 'TIMESTAMP'", + ExpErr: "'id' cannot be cast to 'timestamp'", }, }, } @@ -524,25 +524,25 @@ var castIDSet = TableTest{ SQLs: sqls( "select _id, cast(ids1 as int) from cast_ids", ), - ExpErr: "'IDSET' cannot be cast to 'INT'", + ExpErr: "'idset' cannot be cast to 'int'", }, { SQLs: sqls( "select _id, cast(ids1 as bool) from cast_ids", ), - ExpErr: "'IDSET' cannot be cast to 'BOOL'", + ExpErr: "'idset' cannot be cast to 'bool'", }, { SQLs: sqls( "select _id, cast(ids1 as decimal(2)) from cast_ids", ), - ExpErr: "'IDSET' cannot be cast to 'DECIMAL(2)'", + ExpErr: "'idset' cannot be cast to 'decimal(2)'", }, { SQLs: sqls( "select _id, cast(ids1 as id) from cast_ids", ), - ExpErr: "'IDSET' cannot be cast to 'ID'", + ExpErr: "'idset' cannot be cast to 'id'", }, { SQLs: sqls( @@ -574,13 +574,13 @@ var castIDSet = TableTest{ SQLs: sqls( "select _id, cast(ids1 as stringset) from cast_ids", ), - ExpErr: "'IDSET' cannot be cast to 'STRINGSET'", + ExpErr: "'idset' cannot be cast to 'stringset'", }, { SQLs: sqls( "select _id, cast(ids1 as timestamp) from cast_ids", ), - ExpErr: "'IDSET' cannot be cast to 'TIMESTAMP'", + ExpErr: "'idset' cannot be cast to 'timestamp'", }, }, } @@ -608,7 +608,7 @@ var castString = TableTest{ SQLs: sqls( "select _id, cast(s1 as int) from cast_string", ), - ExpErr: "'foo' cannot be cast to 'INT'", + ExpErr: "'foo' cannot be cast to 'int'", }, { SQLs: sqls( @@ -627,7 +627,7 @@ var castString = TableTest{ SQLs: sqls( "select _id, cast(s1 as bool) from cast_string", ), - ExpErr: "'foo' cannot be cast to 'BOOL'", + ExpErr: "'foo' cannot be cast to 'bool'", }, { SQLs: sqls( @@ -646,7 +646,7 @@ var castString = TableTest{ SQLs: sqls( "select _id, cast(s1 as decimal(2)) from cast_string", ), - ExpErr: "'foo' cannot be cast to 'DECIMAL(2)'", + ExpErr: "'foo' cannot be cast to 'decimal(2)'", }, { SQLs: sqls( @@ -665,7 +665,7 @@ var castString = TableTest{ SQLs: sqls( "select _id, cast(s1 as id) from cast_string", ), - ExpErr: "'foo' cannot be cast to 'ID'", + ExpErr: "'foo' cannot be cast to 'id'", }, { SQLs: sqls( @@ -684,7 +684,7 @@ var castString = TableTest{ SQLs: sqls( "select _id, cast(s1 as idset) from cast_string", ), - ExpErr: "'STRING' cannot be cast to 'IDSET'", + ExpErr: "'string' cannot be cast to 'idset'", }, { SQLs: sqls( @@ -703,13 +703,13 @@ var castString = TableTest{ SQLs: sqls( "select _id, cast(s1 as stringset) from cast_string", ), - ExpErr: "'STRING' cannot be cast to 'STRINGSET'", + ExpErr: "'string' cannot be cast to 'stringset'", }, { SQLs: sqls( "select _id, cast(s1 as timestamp) from cast_string", ), - ExpErr: "'foo' cannot be cast to 'TIMESTAMP'", + ExpErr: "'foo' cannot be cast to 'timestamp'", }, { SQLs: sqls( @@ -750,31 +750,31 @@ var castStringSet = TableTest{ SQLs: sqls( "select _id, cast(ss1 as int) from cast_ss", ), - ExpErr: "'STRINGSET' cannot be cast to 'INT'", + ExpErr: "'stringset' cannot be cast to 'int'", }, { SQLs: sqls( "select _id, cast(ss1 as bool) from cast_ss", ), - ExpErr: "'STRINGSET' cannot be cast to 'BOOL'", + ExpErr: "'stringset' cannot be cast to 'bool'", }, { SQLs: sqls( "select _id, cast(ss1 as decimal(2)) from cast_ss", ), - ExpErr: "'STRINGSET' cannot be cast to 'DECIMAL(2)'", + ExpErr: "'stringset' cannot be cast to 'decimal(2)'", }, { SQLs: sqls( "select _id, cast(ss1 as id) from cast_ss", ), - ExpErr: "'STRINGSET' cannot be cast to 'ID'", + ExpErr: "'stringset' cannot be cast to 'id'", }, { SQLs: sqls( "select _id, cast(ss1 as idset) from cast_ss", ), - ExpErr: "'STRINGSET' cannot be cast to 'IDSET'", + ExpErr: "'stringset' cannot be cast to 'idset'", }, { SQLs: sqls( @@ -807,7 +807,7 @@ var castStringSet = TableTest{ SQLs: sqls( "select _id, cast(ss1 as timestamp) from cast_ss", ), - ExpErr: "'STRINGSET' cannot be cast to 'TIMESTAMP'", + ExpErr: "'stringset' cannot be cast to 'timestamp'", }, }, } @@ -848,25 +848,25 @@ var castTimestamp = TableTest{ SQLs: sqls( "select _id, cast(t1 as bool) from cast_ts", ), - ExpErr: "'TIMESTAMP' cannot be cast to 'BOOL'", + ExpErr: "'timestamp' cannot be cast to 'bool'", }, { SQLs: sqls( "select _id, cast(t1 as decimal(2)) from cast_ts", ), - ExpErr: "'TIMESTAMP' cannot be cast to 'DECIMAL(2)'", + ExpErr: "'timestamp' cannot be cast to 'decimal(2)'", }, { SQLs: sqls( "select _id, cast(t1 as id) from cast_ts", ), - ExpErr: "'TIMESTAMP' cannot be cast to 'ID'", + ExpErr: "'timestamp' cannot be cast to 'id'", }, { SQLs: sqls( "select _id, cast(t1 as idset) from cast_ts", ), - ExpErr: "'TIMESTAMP' cannot be cast to 'IDSET'", + ExpErr: "'timestamp' cannot be cast to 'idset'", }, { SQLs: sqls( @@ -885,7 +885,7 @@ var castTimestamp = TableTest{ SQLs: sqls( "select _id, cast(t1 as stringset) from cast_ts", ), - ExpErr: "'TIMESTAMP' cannot be cast to 'STRINGSET'", + ExpErr: "'timestamp' cannot be cast to 'stringset'", }, { SQLs: sqls( diff --git a/sql3/test/defs/defs_date_functions.go b/sql3/test/defs/defs_date_functions.go index 5b083b6fd..cd35c5099 100644 --- a/sql3/test/defs/defs_date_functions.go +++ b/sql3/test/defs/defs_date_functions.go @@ -26,13 +26,13 @@ var datePartTests = TableTest{ SQLs: sqls( "select datepart(1, 2)", ), - ExpErr: "an expression of type 'INT' cannot be passed to a parameter of type 'STRING'", + ExpErr: "an expression of type 'int' cannot be passed to a parameter of type 'string'", }, { SQLs: sqls( "select datepart('1', 2)", ), - ExpErr: "an expression of type 'INT' cannot be passed to a parameter of type 'TIMESTAMP'", + ExpErr: "an expression of type 'int' cannot be passed to a parameter of type 'timestamp'", }, { SQLs: sqls( diff --git a/sql3/test/defs/defs_inserts.go b/sql3/test/defs/defs_inserts.go index 4608de8a3..a839ea909 100644 --- a/sql3/test/defs/defs_inserts.go +++ b/sql3/test/defs/defs_inserts.go @@ -115,14 +115,14 @@ var insertTest = TableTest{ SQLs: sqls( "insert into testinsert (_id, a, event) values (4, 40, [101, 150])", ), - ExpErr: "an expression of type 'IDSET' cannot be assigned to type 'STRINGSET'", + ExpErr: "an expression of type 'idset' cannot be assigned to type 'stringset'", }, { // InsertSetsTypeError2 SQLs: sqls( "insert into testinsert (_id, a, ievent) values (4, 40, ['POST', 'GET'])", ), - ExpErr: "an expression of type 'STRINGSET' cannot be assigned to type 'IDSET'", + ExpErr: "an expression of type 'stringset' cannot be assigned to type 'idset'", }, }, } diff --git a/sql3/test/defs/defs_like.go b/sql3/test/defs/defs_like.go index e7276bec6..28cfedd9e 100644 --- a/sql3/test/defs/defs_like.go +++ b/sql3/test/defs/defs_like.go @@ -24,37 +24,37 @@ var likeTests = TableTest{ SQLs: sqls( "select _id like '%f_' from like_all_types", ), - ExpErr: "operator 'LIKE' incompatible with type 'ID'", + ExpErr: "operator 'LIKE' incompatible with type 'id'", }, { SQLs: sqls( "select i1 like '%f_' from like_all_types", ), - ExpErr: "operator 'LIKE' incompatible with type 'INT'", + ExpErr: "operator 'LIKE' incompatible with type 'int'", }, { SQLs: sqls( "select b1 like '%f_' from like_all_types", ), - ExpErr: "operator 'LIKE' incompatible with type 'BOOL'", + ExpErr: "operator 'LIKE' incompatible with type 'bool'", }, { SQLs: sqls( "select d1 like '%f_' from like_all_types", ), - ExpErr: "operator 'LIKE' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator 'LIKE' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select id1 like '%f_' from like_all_types", ), - ExpErr: "operator 'LIKE' incompatible with type 'ID'", + ExpErr: "operator 'LIKE' incompatible with type 'id'", }, { SQLs: sqls( "select ids1 like '%f_' from like_all_types", ), - ExpErr: "operator 'LIKE' incompatible with type 'IDSET'", + ExpErr: "operator 'LIKE' incompatible with type 'idset'", }, { SQLs: sqls( @@ -72,13 +72,13 @@ var likeTests = TableTest{ SQLs: sqls( "select ss1 like '%f_' from like_all_types", ), - ExpErr: "operator 'LIKE' incompatible with type 'STRINGSET'", + ExpErr: "operator 'LIKE' incompatible with type 'stringset'", }, { SQLs: sqls( "select t1 like '%f_' from like_all_types", ), - ExpErr: "operator 'LIKE' incompatible with type 'TIMESTAMP'", + ExpErr: "operator 'LIKE' incompatible with type 'timestamp'", }, }, } @@ -107,37 +107,37 @@ var notLikeTests = TableTest{ SQLs: sqls( "select _id not like '%f_' from not_like_all_types", ), - ExpErr: "operator 'NOTLIKE' incompatible with type 'ID'", + ExpErr: "operator 'NOTLIKE' incompatible with type 'id'", }, { SQLs: sqls( "select i1 not like '%f_' from not_like_all_types", ), - ExpErr: "operator 'NOTLIKE' incompatible with type 'INT'", + ExpErr: "operator 'NOTLIKE' incompatible with type 'int'", }, { SQLs: sqls( "select b1 not like '%f_' from not_like_all_types", ), - ExpErr: "operator 'NOTLIKE' incompatible with type 'BOOL'", + ExpErr: "operator 'NOTLIKE' incompatible with type 'bool'", }, { SQLs: sqls( "select d1 not like '%f_' from not_like_all_types", ), - ExpErr: "operator 'NOTLIKE' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator 'NOTLIKE' incompatible with type 'decimal(2)'", }, { SQLs: sqls( "select id1 not like '%f_' from not_like_all_types", ), - ExpErr: "operator 'NOTLIKE' incompatible with type 'ID'", + ExpErr: "operator 'NOTLIKE' incompatible with type 'id'", }, { SQLs: sqls( "select ids1 not like '%f_' from not_like_all_types", ), - ExpErr: "operator 'NOTLIKE' incompatible with type 'IDSET'", + ExpErr: "operator 'NOTLIKE' incompatible with type 'idset'", }, { SQLs: sqls( @@ -155,13 +155,13 @@ var notLikeTests = TableTest{ SQLs: sqls( "select ss1 not like '%f_' from not_like_all_types", ), - ExpErr: "operator 'NOTLIKE' incompatible with type 'STRINGSET'", + ExpErr: "operator 'NOTLIKE' incompatible with type 'stringset'", }, { SQLs: sqls( "select t1 not like '%f_' from not_like_all_types", ), - ExpErr: "operator 'NOTLIKE' incompatible with type 'TIMESTAMP'", + ExpErr: "operator 'NOTLIKE' incompatible with type 'timestamp'", }, }, } diff --git a/sql3/test/defs/defs_null.go b/sql3/test/defs/defs_null.go index 936b13718..5b65478d1 100644 --- a/sql3/test/defs/defs_null.go +++ b/sql3/test/defs/defs_null.go @@ -338,13 +338,13 @@ var nullFilterTests = TableTest{ SQLs: sqls( "select _id from null_filter_all_types where b1 is null", ), - ExpErr: "unsupported type 'BOOL' for is/is not null filter expression", + ExpErr: "unsupported type 'bool' for is/is not null filter expression", }, { SQLs: sqls( "select _id from null_filter_all_types where b1 is not null", ), - ExpErr: "unsupported type 'BOOL' for is/is not null filter expression", + ExpErr: "unsupported type 'bool' for is/is not null filter expression", }, { SQLs: sqls( @@ -374,49 +374,49 @@ var nullFilterTests = TableTest{ SQLs: sqls( "select _id from null_filter_all_types where id1 is null", ), - ExpErr: "unsupported type 'ID' for is/is not null filter expression", + ExpErr: "unsupported type 'id' for is/is not null filter expression", }, { SQLs: sqls( "select _id from null_filter_all_types where id1 is not null", ), - ExpErr: "unsupported type 'ID' for is/is not null filter expression", + ExpErr: "unsupported type 'id' for is/is not null filter expression", }, { SQLs: sqls( "select _id from null_filter_all_types where ids1 is null", ), - ExpErr: "unsupported type 'IDSET' for is/is not null filter expression", + ExpErr: "unsupported type 'idset' for is/is not null filter expression", }, { SQLs: sqls( "select _id from null_filter_all_types where ids1 is not null", ), - ExpErr: "unsupported type 'IDSET' for is/is not null filter expression", + ExpErr: "unsupported type 'idset' for is/is not null filter expression", }, { SQLs: sqls( "select _id from null_filter_all_types where s1 is null", ), - ExpErr: "unsupported type 'STRING' for is/is not null filter expression", + ExpErr: "unsupported type 'string' for is/is not null filter expression", }, { SQLs: sqls( "select _id from null_filter_all_types where s1 is not null", ), - ExpErr: "unsupported type 'STRING' for is/is not null filter expression", + ExpErr: "unsupported type 'string' for is/is not null filter expression", }, { SQLs: sqls( "select _id from null_filter_all_types where ss1 is null", ), - ExpErr: "unsupported type 'STRINGSET' for is/is not null filter expression", + ExpErr: "unsupported type 'stringset' for is/is not null filter expression", }, { SQLs: sqls( "select _id from null_filter_all_types where ss1 is not null", ), - ExpErr: "unsupported type 'STRINGSET' for is/is not null filter expression", + ExpErr: "unsupported type 'stringset' for is/is not null filter expression", }, { SQLs: sqls( diff --git a/sql3/test/defs/defs_orderby.go b/sql3/test/defs/defs_orderby.go index c97d51bcb..8d2deb7fa 100644 --- a/sql3/test/defs/defs_orderby.go +++ b/sql3/test/defs/defs_orderby.go @@ -26,14 +26,14 @@ var orderByTests = TableTest{ SQLs: sqls( "select * from order_by_test order by a_string_set asc", ), - ExpErr: "unable to sort a column of type 'STRINGSET'", + ExpErr: "unable to sort a column of type 'stringset'", }, { name: "order-by-idset", SQLs: sqls( "select * from order_by_test order by an_id_set asc", ), - ExpErr: "unable to sort a column of type 'IDSET'", + ExpErr: "unable to sort a column of type 'idset'", }, }, } diff --git a/sql3/test/defs/defs_set_functions.go b/sql3/test/defs/defs_set_functions.go index 51f474c02..d16dcf3d7 100644 --- a/sql3/test/defs/defs_set_functions.go +++ b/sql3/test/defs/defs_set_functions.go @@ -209,7 +209,7 @@ var setFunctionTests = TableTest{ SQLs: sqls( "select * from selectwithset where setcontains(event, 1)", ), - ExpErr: "types 'STRINGSET' and 'INT' are not equatable", + ExpErr: "types 'stringset' and 'int' are not equatable", }, { // SetContainsWrongTypeInt @@ -217,7 +217,7 @@ var setFunctionTests = TableTest{ SQLs: sqls( "select * from selectwithset where setcontains(ievent, 'foo')", ), - ExpErr: "types 'IDSET' and 'STRING' are not equatable", + ExpErr: "types 'idset' and 'string' are not equatable", }, { // SetContainsWrongTypeSet @@ -225,7 +225,7 @@ var setFunctionTests = TableTest{ SQLs: sqls( "select * from selectwithset where setcontains(event, ['foo'])", ), - ExpErr: "types 'STRINGSET' and 'STRINGSET' are not equatable", + ExpErr: "types 'stringset' and 'stringset' are not equatable", }, }, } @@ -265,13 +265,13 @@ var setParameterTests = TableTest{ SQLs: sqls( "select setcontains(['POST', 'GET'], 1)", ), - ExpErr: "types 'STRINGSET' and 'INT' are not equatable", + ExpErr: "types 'stringset' and 'int' are not equatable", }, { SQLs: sqls( "select setcontains([1, 2], '1')", ), - ExpErr: "types 'IDSET' and 'STRING' are not equatable", + ExpErr: "types 'idset' and 'string' are not equatable", }, { @@ -293,14 +293,14 @@ var setParameterTests = TableTest{ "select setcontainsall(['POST', 'GET'], [1, 2])", "select setcontainsany(['POST', 'GET'], [1, 2])", ), - ExpErr: "types 'STRING' and 'ID' are not equatable", + ExpErr: "types 'string' and 'id' are not equatable", }, { SQLs: sqls( "select setcontainsall([1, 2], ['1', '2'])", "select setcontainsany([1, 2], ['1', '2'])", ), - ExpErr: "types 'ID' and 'STRING' are not equatable", + ExpErr: "types 'id' and 'string' are not equatable", }, }, } diff --git a/sql3/test/defs/defs_timequantum.go b/sql3/test/defs/defs_timequantum.go index 6b4a0b5e2..94ad34b52 100644 --- a/sql3/test/defs/defs_timequantum.go +++ b/sql3/test/defs/defs_timequantum.go @@ -47,7 +47,7 @@ var timeQuantumQueryTest = TableTest{ SQLs: sqls( "select _id not like '%f_' from not_like_all_types", ), - ExpErr: "operator 'NOTLIKE' incompatible with type 'ID'", + ExpErr: "operator 'NOTLIKE' incompatible with type 'id'", }, }, } diff --git a/sql3/test/defs/defs_unops.go b/sql3/test/defs/defs_unops.go index 9cbb611ad..f907a99c9 100644 --- a/sql3/test/defs/defs_unops.go +++ b/sql3/test/defs/defs_unops.go @@ -73,19 +73,19 @@ var unaryOpExprWithBool = TableTest{ SQLs: sqls( "select -i from unoptest_b;", ), - ExpErr: "operator '-' incompatible with type 'BOOL'", + ExpErr: "operator '-' incompatible with type 'bool'", }, { SQLs: sqls( "select !i from unoptest_b;", ), - ExpErr: "operator '!' incompatible with type 'BOOL'", + ExpErr: "operator '!' incompatible with type 'bool'", }, { SQLs: sqls( "select +i from unoptest_b;", ), - ExpErr: "operator '+' incompatible with type 'BOOL'", + ExpErr: "operator '+' incompatible with type 'bool'", }, }, } @@ -169,7 +169,7 @@ var unaryOpExprWithDecimal = TableTest{ SQLs: sqls( "select !d from unoptestd;", ), - ExpErr: "operator '!' incompatible with type 'DECIMAL(2)'", + ExpErr: "operator '!' incompatible with type 'decimal(2)'", }, { SQLs: sqls( @@ -202,19 +202,19 @@ var unaryOpExprWithTimestamp = TableTest{ SQLs: sqls( "select -ts from unoptestts;", ), - ExpErr: "operator '-' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '-' incompatible with type 'timestamp'", }, { SQLs: sqls( "select !ts from unoptestts;", ), - ExpErr: "operator '!' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '!' incompatible with type 'timestamp'", }, { SQLs: sqls( "select +ts from unoptestts;", ), - ExpErr: "operator '+' incompatible with type 'TIMESTAMP'", + ExpErr: "operator '+' incompatible with type 'timestamp'", }, }, } @@ -235,19 +235,19 @@ var unaryOpExprWithIDSet = TableTest{ SQLs: sqls( "select -ids from unoptestids;", ), - ExpErr: "operator '-' incompatible with type 'IDSET'", + ExpErr: "operator '-' incompatible with type 'idset'", }, { SQLs: sqls( "select !ids from unoptestids;", ), - ExpErr: "operator '!' incompatible with type 'IDSET'", + ExpErr: "operator '!' incompatible with type 'idset'", }, { SQLs: sqls( "select +ids from unoptestids;", ), - ExpErr: "operator '+' incompatible with type 'IDSET'", + ExpErr: "operator '+' incompatible with type 'idset'", }, }, } @@ -268,19 +268,19 @@ var unaryOpExprWithString = TableTest{ SQLs: sqls( "select -s from unoptest_s;", ), - ExpErr: "operator '-' incompatible with type 'STRING'", + ExpErr: "operator '-' incompatible with type 'string'", }, { SQLs: sqls( "select !s from unoptest_s;", ), - ExpErr: "operator '!' incompatible with type 'STRING'", + ExpErr: "operator '!' incompatible with type 'string'", }, { SQLs: sqls( "select +s from unoptest_s;", ), - ExpErr: "operator '+' incompatible with type 'STRING'", + ExpErr: "operator '+' incompatible with type 'string'", }, }, } @@ -301,19 +301,19 @@ var unaryOpExprWithStringSet = TableTest{ SQLs: sqls( "select -s from unoptestss;", ), - ExpErr: "operator '-' incompatible with type 'STRINGSET'", + ExpErr: "operator '-' incompatible with type 'stringset'", }, { SQLs: sqls( "select !s from unoptestss;", ), - ExpErr: "operator '!' incompatible with type 'STRINGSET'", + ExpErr: "operator '!' incompatible with type 'stringset'", }, { SQLs: sqls( "select +s from unoptestss;", ), - ExpErr: "operator '+' incompatible with type 'STRINGSET'", + ExpErr: "operator '+' incompatible with type 'stringset'", }, }, } diff --git a/sql3/test/helpers.go b/sql3/test/helpers.go index 20335ed94..050f64c0a 100644 --- a/sql3/test/helpers.go +++ b/sql3/test/helpers.go @@ -3,7 +3,6 @@ package test import ( "context" - "strings" "testing" featurebase "github.com/molecula/featurebase/v3" @@ -59,8 +58,8 @@ func MustQueryRows(tb testing.TB, svr *featurebase.Server, q string) ([][]interf for _, oc := range ocolumns { cols = append(cols, &featurebase.WireQueryField{ Name: dax.FieldName(oc.ColumnName), - Type: strings.ToLower(oc.Type.TypeDescription()), - BaseType: dax.BaseType(strings.ToLower(oc.Type.TypeName())), + Type: oc.Type.TypeDescription(), + BaseType: dax.BaseType(oc.Type.BaseTypeName()), TypeInfo: oc.Type.TypeInfo(), }) }