File tree Expand file tree Collapse file tree
internal/stackql/astvisit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,6 +109,15 @@ func (v *standardQueryRewriteAstVisitor) isJSONEachCompatible(col parserutil.Col
109109 return isJSONEachCompatibleRegexp .MatchString (s )
110110}
111111
112+ func (v * standardQueryRewriteAstVisitor ) isAnonymous (col parserutil.ColumnHandle ) bool {
113+ switch col .Expr .(type ) {
114+ case * sqlparser.OrExpr :
115+ return true
116+ default :
117+ return false
118+ }
119+ }
120+
112121// TODO: introduce dependency on RDBMS
113122func (v * standardQueryRewriteAstVisitor ) getTypeFromParserType (t sqlparser.ValType ) string {
114123 //nolint:exhaustive // acceptable
@@ -693,7 +702,7 @@ func (v *standardQueryRewriteAstVisitor) Visit(node sqlparser.SQLNode) error {
693702 } else {
694703 r , ok := indirect .GetColumnByName (col .Name )
695704 if ! ok {
696- if ! v .isJSONEachCompatible (col ) {
705+ if ! v .isJSONEachCompatible (col ) && ! v . isAnonymous ( col ) {
697706 return fmt .Errorf ("query rewriting for indirection: cannot find col = '%s'" , col .Name )
698707 }
699708 relationalCol = typing .NewRelationalColumn (col .Name , "" ).WithDecorated (col .DecoratedColumn ) // TOOO: clean this up
Original file line number Diff line number Diff line change @@ -4268,6 +4268,27 @@ Filtered Projection Detail Resource Level View of Cloud Control Resource Returns
42684268 ... ${outputStr}
42694269 ... ${CURDIR}/tmp/Filtered-Projection-Detail-Resource-Level-View-of-Cloud-Control-Resource-Returns-Expected-Result.tmp
42704270
4271+ View String Concatenation Filtered Projection Detail Resource Level View of Cloud Control Resource Returns Expected Result
4272+ ${inputStr} = Catenate
4273+ ... select domain_name, 'Descriptor:' || arn as descriptor from aws.pseudo_s3.s3_bucket_detail where data__Identifier = 'stackql-testing-bucket-01';
4274+ ${outputStr} = Catenate SEPARATOR=\n
4275+ ... |--------------------------------------------|---------------------------------------------------|
4276+ ... |${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}domain_name${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}|${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}descriptor${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}|
4277+ ... |--------------------------------------------|---------------------------------------------------|
4278+ ... |${SPACE}stackql-testing-bucket-01.s3.amazonaws.com${SPACE}|${SPACE}Descriptor:arn:aws:s3:::stackql-testing-bucket-01${SPACE}|
4279+ ... |--------------------------------------------|---------------------------------------------------|
4280+ Should Horrid Query StackQL Inline Equal
4281+ ... ${STACKQL_EXE}
4282+ ... ${OKTA_SECRET_STR}
4283+ ... ${GITHUB_SECRET_STR}
4284+ ... ${K8S_SECRET_STR}
4285+ ... ${REGISTRY_NO_VERIFY_CFG_STR}
4286+ ... ${AUTH_CFG_STR}
4287+ ... ${SQL_BACKEND_CFG_STR_CANONICAL}
4288+ ... ${inputStr}
4289+ ... ${outputStr}
4290+ ... ${CURDIR}/tmp/View-String-Concatenation-Filtered-Projection-Detail-Resource-Level-View-of-Cloud-Control-Resource-Returns-Expected-Result.tmp
4291+
42714292Filtered Star Resource Level View of Cloud Control Resource Returns Expected Result
42724293 Should Horrid Query StackQL Inline Equal
42734294 ... ${STACKQL_EXE}
You can’t perform that action at this time.
0 commit comments