Closed AK47Sonic closed 7 months ago
Can you include the full stack trace? How do you quote the query? The example you included is not correctly quoted
rows, err := db.Query( select * from table( system.procedure( query => 'execute testTrino' ) );
)
trino: query failed (200 OK): "io.trino.sql.parser.ParsingException: line 9:3: mismatched input ';'. Expecting: ',', 'AS', 'CROSS', 'EXCEPT', 'FETCH', 'FULL', 'GROUP', 'HAVING', 'INNER', ....." panic: runtime error: invalid memory address or nil pointer dereference panic : runtime error: invalid memory address or nil pointer deference [signal 0xc0000005 code =0x0 addr=ox80 pc=ox6ac74e]
After I remove ; in the end of sql, it works fine now.
rows, err := db.Query( select * from table( system.procedure( query => 'execute testTrino' ) ) // remove ;
)
Yeah ;
are not allowed in queries, as the driver cannot execute multiple statements at once.
When I enable sqlserver.experimental.stored-procedure-table-function-enabled=true and call the stored procedure of SQL Server, the ParsingException is thrown. Seems the feature is not supported by go client. I also try the trino cli. It works fine. Could you help to enhance this feature?
db.Query(
SELECT * FROM TABLE( system.procedure( query => 'EXECUTE example_schema.employee_sp' ) );
)