Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,12 @@ function meta::pure::tds::toRelation::transform(a:AppliedFunction[1], extensions

appliedFunction(project_C_MANY__FuncColSpecArray_1__Relation_1_, [$a.parameters->at(0)->transform($extensions), $columns]);
),
//TODO activate when relation inference is fixed on project
// pair(project_TabularDataSet_1__ColumnSpecification_MANY__TabularDataSet_1_->cast(@Function<Any>),
// |
// let columns = $a.parameters->at(1)->colsToColSpecArrayInstance($extensions);
pair(project_TabularDataSet_1__ColumnSpecification_MANY__TabularDataSet_1_->cast(@Function<Any>),
|
let columns = $a.parameters->at(1)->colsToColSpecArrayInstance($extensions);

// appliedFunction(project_Relation_1__FuncColSpecArray_1__Relation_1_, [$a.parameters->at(0)->transform($extensions), $columns]);
// ),
appliedFunction(project_Relation_1__FuncColSpecArray_1__Relation_1_, [$a.parameters->at(0)->transform($extensions), $columns]);
),
pair(groupBy_K_MANY__Function_MANY__AggregateValue_MANY__String_MANY__TabularDataSet_1_->cast(@Function<Any>),
|
let groupByColumns = $a.parameters->at(1)->fromCollection()->cast(@Lambda);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,38 +69,37 @@ function <<test.Test>> meta::pure::tds::toRelation::testProjectSingle():Boolean[
);
}

//TODO activate when relation inference is fixed on project
// function <<test.Test>> meta::pure::tds::toRelation::testTDSProjectSingle():Boolean[1]
// {
// test(
// {| TestClass.all()
// ->project(col(x | $x.string, 'str'))
// ->project(col(x:TDSRow[1] | $x.getString('str')->toOne() + 'abc', 'newCol'))},
// {| TestClass.all()
// ->project(~[str: x | $x.string])
// ->project(~[newCol : x | $x.str->toOne() + 'abc'])}
// );
// }

// function <<test.Test>> meta::pure::tds::toRelation::testTDSProjectMulti():Boolean[1]
// {
// test(
// {| TestClass.all()
// ->project([col(x | $x.string, 'str'), col(x | $x.integer, 'int')])
// ->project([
// col(x:TDSRow[1] | $x.getString('str')->toOne() + 'abc', 'newCol'),
// col(x:TDSRow[1] | $x.getString('str')->toOne() + 'def', 'newCol2')
// ])},
// {| TestClass.all()
// ->project(~[str: x | $x.string, int: x | $x.integer])
// ->project(~[
// newCol : x | $x.str->toOne() + 'abc',
// newCol2 : x | $x.str->toOne() + 'def'
// ])
// }
// );
// }

function <<test.Test>> meta::pure::tds::toRelation::testTDSProjectSingle():Boolean[1]
{
test(
{| TestClass.all()
->project(col(x | $x.string, 'str'))
->project(col(x:TDSRow[1] | $x.getString('str')->toOne() + 'abc', 'newCol'))},
{| TestClass.all()
->project(~[str: x | $x.string])
->project(~[newCol : x | $x.str->toOne() + 'abc'])}
);
}

function <<test.Test>> meta::pure::tds::toRelation::testTDSProjectMulti():Boolean[1]
{
test(
{| TestClass.all()
->project([col(x | $x.string, 'str'), col(x | $x.integer, 'int')])
->project([
col(x:TDSRow[1] | $x.getString('str')->toOne() + 'abc', 'newCol'),
col(x:TDSRow[1] | $x.getString('str')->toOne() + 'def', 'newCol2')
])},
{| TestClass.all()
->project(~[str: x | $x.string, int: x | $x.integer])
->project(~[
newCol : x | $x.str->toOne() + 'abc',
newCol2 : x | $x.str->toOne() + 'def'
])
}
);
}

function <<test.Test>> meta::pure::tds::toRelation::testExtendSingle():Boolean[1]
{
Expand Down