Skip to content

Commit

Permalink
netsting_variables_across_cells (byzer-org#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
anan0120 authored Dec 31, 2021
1 parent 7e4ce80 commit 05a7b1c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class SetAdaptor(scriptSQLExecListener: ScriptSQLExecListener, stage: Stage.stag
if (mergedValue != v) {
scriptSQLExecListener.addEnv(k, mergedValue)
if (scope == "session"){
scriptSQLExecListener.addSessionEnv(key, value,visibility.mkString(","))
scriptSQLExecListener.addSessionEnv(key, mergedValue,visibility.mkString(","))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--%comparator=tech.mlsql.it.IgnoreResultComparator
-- first cell

set table_name="T_TableName" where scope="session";
set ods_table_name="ODS_${table_name}" where scope="session";
select "${ods_table_name}" as name as `${ods_table_name}`;

-- second cell

select name from `${ods_table_name}` as result;

-- make sure The variable name should be ODS_T_TableName.
!assert result ''':name=="ODS_T_TableName"''' "The variable name should be ODS_T_TableName";

0 comments on commit 05a7b1c

Please sign in to comment.