RESULT_SCAN (Lakehouse v1)
Returns the result set of a previous command in same session as if the result was a table.
SQL Syntax
Section titled “SQL Syntax”RESULT_SCAN( { '<query_id>' | LAST_QUERY_ID() } )SQL Examples
Section titled “SQL Examples”Create a simple table:
CREATE TABLE t1(a int);Insert some values;
INSERT INTO t1(a) VALUES (1), (2), (3);result_scan
Section titled “result_scan”SELECT * FROM t1 ORDER BY a;┌───────┐│ a │├───────┤│ 1 │├───────┤│ 2 │├───────┤│ 3 │└───────┘SELECT * FROM RESULT_SCAN(LAST_QUERY_ID()) ORDER BY a;┌───────┐│ a │├───────┤│ 1 │├───────┤│ 2 │├───────┤│ 3 │└───────┘