cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

ERROR: key not found in SQL when trying to pass the result of a CTE as a function parameter

JS_L
Visitor

Hi Community,
I try to pass the result of a CTE as a function parameter as code below

 

WITH t1 AS (
    SELECT array_join(collect_list(output), ',') AS x
    FROM my_catalog.my_db.get_x(:startTime, :endTime)
)
SELECT 'AM_offline' as Type, CASE WHEN offline_ratio > 1.5 THEN 'no-Go' ELSE 'Go' END as Status
FROM my_catalog.my_db.get_ratio (
    _startTime => :startTime, 
    _endTime => :endTime, 
    _x => (SELECT x FROM t1 LIMIT 1)
)

 

However, I encounter the key not found error. Can someone tell me, what is the reason of such error?

 

key not found: 863

 

Thank you.

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group