@@ -152,6 +152,9 @@ func TestCatalog(t *testing.T) {
152
152
langOpt := zetasql .NewLanguageOptions ()
153
153
langOpt .SetNameResolutionMode (zetasql .NameResolutionDefault )
154
154
langOpt .SetProductMode (types .ProductExternal )
155
+ langOpt .SetEnabledLanguageFeatures ([]zetasql.LanguageFeature {
156
+ zetasql .FeatureTemplateFunctions ,
157
+ })
155
158
langOpt .SetSupportedStatementKinds ([]resolved_ast.Kind {resolved_ast .QueryStmt })
156
159
opt := zetasql .NewAnalyzerOptions ()
157
160
opt .SetAllowUndeclaredParameters (true )
@@ -176,14 +179,22 @@ func TestCatalog(t *testing.T) {
176
179
types .ScalarMode ,
177
180
[]* types.FunctionSignature {
178
181
types .NewFunctionSignature (
179
- types .NewFunctionArgumentType ("" , types .StringType ()),
180
- nil ,
182
+ types .NewFunctionArgumentType (
183
+ types .StringType (),
184
+ types .NewFunctionArgumentTypeOptions (types .RequiredArgumentCardinality ),
185
+ ),
186
+ []* types.FunctionArgumentType {
187
+ types .NewTemplatedFunctionArgumentType (
188
+ types .ArgTypeAny1 ,
189
+ types .NewFunctionArgumentTypeOptions (types .RequiredArgumentCardinality ),
190
+ ),
191
+ },
181
192
),
182
193
},
183
194
),
184
195
},
185
196
}
186
- query := `SELECT * FROM sample_table WHERE MY_FUNC() = 'foo'`
197
+ query := `SELECT * FROM sample_table WHERE MY_FUNC(1.0 ) = 'foo'`
187
198
if _ , err := zetasql .AnalyzeStatement (query , catalog , opt ); err != nil {
188
199
t .Fatal (err )
189
200
}
0 commit comments