incubator-livy icon indicating copy to clipboard operation
incubator-livy copied to clipboard

Escape backtick from spark-submit arguments

Open s0nskar opened this issue 2 years ago • 3 comments

Currently, livy does not escape backticks from user-provided spark-submit arguments. So if a customer is passing any arguments that contain backticks, it will be considered as command substitution during spark-submit causing that argument to become blank or invalid.

Example:

--query 'select * from test_db.`test_table`' 

will become

--query 'select * from test_db.' 

s0nskar avatar Aug 24 '23 11:08 s0nskar

cc: @pralabhkumar

s0nskar avatar Aug 24 '23 11:08 s0nskar

I'm working on this.

s0nskar avatar Aug 24 '23 14:08 s0nskar

@s0nskar Thank you for working on this. My company uses AWS EMR for our data processing tasks. EMR uses livy to handle job submissions, and we noticed the same issue when submitting queries with backticks. This has resulted us having to change the queries on our side. And it prevented us from using dot notations in our query ALIAS.

For example, the following will not work

  COALESCE(
    `measure`.`region`,
  ) AS `measure_alias.region_alias`

It would be nice if we could have this change included in the up coming livy releases.

RonZhang724 avatar Feb 14 '24 15:02 RonZhang724