Skip to content

Commit

Permalink
fix group by alias translation in duck db
Browse files Browse the repository at this point in the history
  • Loading branch information
PrateekGarg-gs committed Oct 1, 2024
1 parent d6798e2 commit e5239d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ function <<access.private>> meta::relational::functions::sqlQueryToString::duckD
)
) +
if (eq($opStr, ''), |'', | ' ' + $format.separator + 'where ' + $opStr) +
if ($s.groupBy->isEmpty(),|'',| ' ' + $format.separator + 'group by '+$s.groupBy->processGroupByColumns($dbConfig, $format->indent(), true, $extensions)->makeString(',')) +
if ($s.groupBy->isEmpty(),|'',| ' ' + $format.separator + 'group by '+$s.groupBy->processGroupByColumns($dbConfig, $format->indent(), false, $extensions)->makeString(',')) +
if (eq($havingStr, ''), |'', | ' ' + $format.separator + 'having ' + $havingStr) +
if ($s.orderBy->isEmpty(),|'',| ' ' + $format.separator + 'order by '+ $s.orderBy->processOrderBy($dbConfig, $format->indent(), $config, $extensions)->makeString(',')) +
processLimit($s, $dbConfig, $format, $extensions, processTakeDefault_SelectSQLQuery_1__Format_1__DbConfig_1__Extension_MANY__String_1_, processSliceOrDropForDuckDB_SelectSQLQuery_1__Format_1__DbConfig_1__Extension_MANY__Any_1__String_1_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ function <<paramTest.Test>> meta::relational::tests::dbSpecificTests::sqlQueryTe

meta::relational::dbTestRunner::doSetupOnConnection($records, meta::relational::tests::dbSpecificTests::sqlQueryTests::ddl::db,
$config, meta::relational::extension::relationalExtensions());
// if there is any error in creating table or inserting data > the test fails
true;
}


function <<paramTest.Test>> meta::relational::tests::dbSpecificTests::sqlQueryTests::ddl::testCreateTableForAllColumnDataTypes(config:DbTestConfig[1]):Boolean[1]
{
//insert empty data > ensure create table statement is properly transl;ated for all column data types
//insert empty data > ensure create table statement is properly translated for all column data types
meta::relational::dbTestRunner::doSetupOnConnection('', meta::relational::tests::dbSpecificTests::sqlQueryTests::ddl::dataTypeDB,
$config, meta::relational::extension::relationalExtensions());
true;
Expand Down

0 comments on commit e5239d2

Please sign in to comment.