mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
fb-2049 improve test coverage for select statement (#2339)
This commit is contained in:
parent
82700264e2
commit
9e39eee9c9
4 changed files with 37 additions and 17 deletions
|
|
@ -150,6 +150,7 @@ func TestDAXIntegration(t *testing.T) {
|
|||
"viewtests/drop-view-if-exists-after-drop",
|
||||
"viewtests/select-view-after-drop",
|
||||
"time_quantum_insert/test-12", // orchestrator currently does not support to,from args on Rows()
|
||||
"select-having/string", // fails in DAX because the string isn't translated.
|
||||
}
|
||||
|
||||
doSkip := func(name string) bool {
|
||||
|
|
|
|||
|
|
@ -573,7 +573,7 @@ func (p *ExecutionPlanner) analyzeSource(ctx context.Context, source parser.Sour
|
|||
return source, nil
|
||||
|
||||
case *parser.TableValuedFunction:
|
||||
return nil, sql3.NewErrInternalf("table valued function expected")
|
||||
return nil, sql3.NewErrUnsupported(0, 0, true, "table valued function")
|
||||
|
||||
case *parser.SelectStatement:
|
||||
expr, err := p.analyzeSelectStatement(ctx, source)
|
||||
|
|
|
|||
|
|
@ -119,21 +119,21 @@ var selectHavingTests = TableTest{
|
|||
Compare: CompareExactUnordered,
|
||||
SortStringKeys: true,
|
||||
},
|
||||
// Fails in DAX because the string isn't translated.
|
||||
// {
|
||||
// name: "string",
|
||||
// SQLs: sqls(
|
||||
// "select a_string, count(*) from having_test group by a_string having count(*) > 1",
|
||||
// ),
|
||||
// ExpHdrs: hdrs(
|
||||
// hdr("a_string", fldTypeString),
|
||||
// hdr("", fldTypeInt),
|
||||
// ),
|
||||
// ExpRows: rows(
|
||||
// row(string("str1"), int64(2)),
|
||||
// ),
|
||||
// Compare: CompareExactUnordered,
|
||||
// SortStringKeys: true,
|
||||
// },
|
||||
// may fail in DAX due to missing string translation.
|
||||
{
|
||||
name: "string",
|
||||
SQLs: sqls(
|
||||
"select a_string, count(*) from having_test group by a_string having count(*) > 1",
|
||||
),
|
||||
ExpHdrs: hdrs(
|
||||
hdr("a_string", fldTypeString),
|
||||
hdr("", fldTypeInt),
|
||||
),
|
||||
ExpRows: rows(
|
||||
row(string("str1"), int64(2)),
|
||||
),
|
||||
Compare: CompareExactUnordered,
|
||||
SortStringKeys: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,6 +136,25 @@ var joinTests = TableTest{
|
|||
),
|
||||
Compare: CompareExactOrdered,
|
||||
},
|
||||
// test u.* and expect select list is expanded to all collumns in table alias u
|
||||
{
|
||||
name: "join-select-start",
|
||||
SQLs: sqls(
|
||||
"select distinct u.* from users u join orders o on o.userid = u._id;",
|
||||
),
|
||||
ExpHdrs: hdrs(
|
||||
hdr("_id", fldTypeID),
|
||||
hdr("name", fldTypeString),
|
||||
hdr("age", fldTypeInt),
|
||||
),
|
||||
ExpRows: rows(
|
||||
row(int64(0), string("a"), int64(21)),
|
||||
row(int64(1), string("b"), int64(18)),
|
||||
row(int64(2), string("c"), int64(28)),
|
||||
row(int64(3), string("d"), int64(34)),
|
||||
),
|
||||
Compare: CompareExactOrdered,
|
||||
},
|
||||
{
|
||||
name: "fulljoin",
|
||||
SQLs: sqls(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue