Home > Software engineering >  Extraneous input '\' expecting {')', ','}. Query working in sql noteb
Extraneous input '\' expecting {')', ','}. Query working in sql noteb

Time:02-10

When executing the following query

SELECT * FROM companies JOIN employments on companies.company_normalized LIKE CONCAT('%',
    replace(employments.displayname_normalized, '\\', ''), '%') or employments.displayname_normalized LIKE CONCAT(
    '%', replace(companies.company_normalized,'\\', ''), '%')

it works fine on databricks sql notebook cell.

However, when attempting to run this same query using spark sql executor, ie spark.sql(query), this errors out saying: Extraneous input '' expecting {')', ','} within the replace clause.

Is there a fix for this?

CodePudding user response:

  •  Tags:  
  • Related