0

I have a schema that looks like this: Table: org_table

`transaction_amt` VARCHAR(64) NOT NULL,
`transaction_adj_amt` BIGINT NOT NULL ,
`event_time` TIMESTAMP(3),
`fd_output` ROW<`restime`  BIGINT `outcome` VARCHAR(64)>,

When I query this table like this:

SELECT transaction_amt, transaction_adj_amt, event_time, fd_output.restime as response_time, fd_output.outcome as outcome,  YEAR(event_time), MONTH(event_time) 
           FROM org_table

When running the above query on the table I am getting an error. Is there something I am missing here?

scala.MatchError: CAST (of class org.apache.calcite.sql.fun.SqlCastFunction
Tomerikoo
  • 18,379
  • 16
  • 47
  • 61

2 Answers2

0

Maybe you need to pay attention to the input parameters of Flink built-in functions, such as YEAR and MONTH functions, their input parameters are date types

Flink built-in function description can refer to https://ci.apache.org/projects/flink/flink-docs-release-1.13/docs/dev/table/functions/systemfunctions/

ChangLi
  • 772
  • 2
  • 8
0

Try fd_output.get(0) to access restime, fd_output.get(1) for outcome.

Tomerikoo
  • 18,379
  • 16
  • 47
  • 61
w_upasana
  • 11
  • 3