Skip to content

Commit

Permalink
feat(tvf): add table schema for update operation
Browse files Browse the repository at this point in the history
  • Loading branch information
ingarabr committed Nov 8, 2023
1 parent c0f9134 commit e5ea400
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ object RoutineUpdateOperation {
.setLanguage("SQL")
.setBody(tvf.query.asString)
// function not public in Builder: .setDescription(tvf.description.orNull)
// TODO .setReturnTableType(tvf.schema.???)
.setReturnTableType(
StandardSQLTableType
.newBuilder()
.setColumns(
tvf.schema.fields
.map(field => StandardSQLField.newBuilder(field.name, toSqlDataType(BQType.fromField(field))).build())
.asJava)
.build()
)
.build()

private def createUdfRoutineInfo(udf: UDF.Persistent[_]) = {
Expand Down

0 comments on commit e5ea400

Please sign in to comment.