Error column operands are not allowed in literal expressions adf

Aditya Raj 286 Reputation points
2021-06-16T15:54:50.463+00:00

106236-image.png

i am getting this error Column operands are not allowed in literal expressions.

How can i append an expressions with string in dynamic query while creating a source dataset in dataflow.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,761 questions
{count} votes

Accepted answer
  1. Mark Kromer MSFT 1,146 Reputation points
    2021-06-16T17:00:28.54+00:00

    Make sure you type in expressions inside the expression builder. Otherwise, ADF is interpreting your input as a query string. Inside the Expression Builder, you can just use string interpolation by putting the query and {$parameter} inside double quotes w/o concat: https://learn.microsoft.com/en-us/azure/data-factory/concepts-data-flow-expression-builder#string-interpolation

    2 people found this answer helpful.

3 additional answers

Sort by: Most helpful
  1. Brian Polk 6 Reputation points
    2022-02-16T16:37:42.09+00:00

    I just had this same exact issue. Check how you are setting your default values on data flow parameters. Could possibly be in other places too. When setting up the input parameters under debug settings, just using literals results in red outline and indicates an issue. I removed the toString('Parameter1') I originally had and ended up leaving everything blank there. On the data flow its self, I set default values for debugging purposes and used the "Parameter1" syntax. When calling the dataflow via a pipeline it forces you to choose between pipeline expression or data flow expression. Originally i had pipeline express with @ hide ('Parameter1') with the Expression checkbox checked. I changed this to data flow expression and used the "Parameter1" syntax and after that, I was finally able to resolve this error. This is a terribly poor and undocumented issue that should be made clearer

    1 person found this answer helpful.

  2. Manuel Bustamante 42 Reputation points
    2022-02-11T15:22:53.21+00:00

    Hi all,

    I'm getting the same error. Did you manage to solve it?

    0 comments No comments

  3. Manuel Bustamante 42 Reputation points
    2022-03-31T21:29:34.27+00:00

    @Anonymous this worked for me. Just keep in mind that in the pipeline you must uncheck column expression when you are passing the parameters!!!!!!

    1. Pipeline. this is how I pass the parameters to the data flow:

    188919-image.png

    1. Dataflow: these are the parameters inside the dataflow:

    188886-image.png

    1. Dataflow: this is my source sink inside the dataflow:

    188928-image.png

    1. Dataflow: this is the expression builder of the query I use inside the source sink:

    188944-image.png