S06002

Error Code

S06002

Error Message

'share' statement can't be declared within a function definition. RefId: S06002

Probable Causes

The share statement cannot be used within a function definition. Otherwise, this error will be reported. For example:

def my_func() { 
    t = table(1 2 3 as id, 4 5 6 as val)
    share t as T
}

Solutions

  • Do not use the share statement within a function definition.
  • Replace the share statement inside the function body with the share function.