Skip to content

Instantly share code, notes, and snippets.

@nyck33
Created November 30, 2023 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nyck33/d62bc863d5a16f6b28cd0322b7d45149 to your computer and use it in GitHub Desktop.
Save nyck33/d62bc863d5a16f6b28cd0322b7d45149 to your computer and use it in GitHub Desktop.
Snowflake Data Engineering Stored Procedure error
(snowflake-demo) @nyck33 ➜ /workspaces/sfguide-data-engineering-with-snowpark-python/steps/05_fahrenheit_to_celsius_udf (main) $ snow procedure execute -p "orders_update_sp()"
Error executing sql:
use role HOL_ROLE;
use warehouse HOL_WH;
use database HOL_DB;
use schema ANALYTICS;
call orders_update_sp();
002140 (42601): SQL compilation error:
Unknown function ORDERS_UPDATE_SP
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowcli/cli/procedure.py:217 in      │
│ procedure_execute                                                                                │
│                                                                                                  │
│   214 │   │   help="Procedure with inputs. E.g. 'hello(int, string)'. Must exactly match those   │
│   215 │   ),                                                                                     │
│   216 ):                                                                                         │
│ ❱ 217 │   snowpark_execute("procedure", environment, select)                                     │
│   218                                                                                            │
│   219                                                                                            │
│   220 @app.command("describe")                                                                   │
│                                                                                                  │
│ ╭────────────── locals ──────────────╮                                                           │
│ │ environment = 'dev'                │                                                           │
│ │      select = 'orders_update_sp()' │                                                           │
│ ╰────────────────────────────────────╯                                                           │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowcli/cli/snowpark_shared.py:408   │
│ in snowpark_execute                                                                              │
│                                                                                                  │
│   405 │   │   │   │   warehouse=env_conf["warehouse"],                                           │
│   406 │   │   │   )                                                                              │
│   407 │   │   elif type == "procedure":                                                          │
│ ❱ 408 │   │   │   results = config.snowflake_connection.executeProcedure(                        │
│   409 │   │   │   │   procedure=select,                                                          │
│   410 │   │   │   │   database=env_conf["database"],                                             │
│   411 │   │   │   │   schema=env_conf["schema"],                                                 │
│                                                                                                  │
│ ╭───────────────── locals ─────────────────╮                                                     │
│ │    env_conf = {                          │                                                     │
│ │               │   'database': 'HOL_DB',  │                                                     │
│ │               │   'schema': 'ANALYTICS', │                                                     │
│ │               │   'warehouse': 'HOL_WH', │                                                     │
│ │               │   'role': 'HOL_ROLE',    │                                                     │
│ │               │   'overwrite': True      │                                                     │
│ │               }                          │                                                     │
│ │ environment = 'dev'                      │                                                     │
│ │      select = 'orders_update_sp()'       │                                                     │
│ │        type = 'procedure'                │                                                     │
│ ╰──────────────────────────────────────────╯                                                     │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowcli/snow_connector.py:179 in     │
│ executeProcedure                                                                                 │
│                                                                                                  │
│   176 │   │   role,                                                                              │
│   177 │   │   warehouse,                                                                         │
│   178 │   ) -> SnowflakeCursor:                                                                  │
│ ❱ 179 │   │   return self.runSql(                                                                │
│   180 │   │   │   "call_procedure",                                                              │
│   181 │   │   │   {                                                                              │
│   182 │   │   │   │   "database": database,                                                      │
│                                                                                                  │
│ ╭───────────────────────────────────── locals ─────────────────────────────────────╮             │
│ │  database = 'HOL_DB'                                                             │             │
│ │ procedure = 'orders_update_sp()'                                                 │             │
│ │      role = 'HOL_ROLE'                                                           │             │
│ │    schema = 'ANALYTICS'                                                          │             │
│ │      self = <snowcli.snow_connector.SnowflakeConnector object at 0x7f1461860370> │             │
│ │ warehouse = 'HOL_WH'                                                             │             │
│ ╰──────────────────────────────────────────────────────────────────────────────────╯             │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowcli/snow_connector.py:666 in     │
│ runSql                                                                                           │
│                                                                                                  │
│   663 │   │   │   if show_exceptions:                                                            │
│   664 │   │   │   │   print(f"Error executing sql:\n{sql}")                                      │
│   665 │   │   │   │   print(e)                                                                   │
│ ❱ 666 │   │   │   raise (e)                                                                      │
│   667 │                                                                                          │
│   668 │   def generate_signature_from_params(self, params: str) -> str:                          │
│   669 │   │   if params == "()":                                                                 │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │         command = 'call_procedure'                                                           │ │
│ │         context = {                                                                          │ │
│ │                   │   'database': 'HOL_DB',                                                  │ │
│ │                   │   'schema': 'ANALYTICS',                                                 │ │
│ │                   │   'role': 'HOL_ROLE',                                                    │ │
│ │                   │   'warehouse': 'HOL_WH',                                                 │ │
│ │                   │   'procedure': 'orders_update_sp()'                                      │ │
│ │                   }                                                                          │ │
│ │             env = <jinja2.environment.Environment object at 0x7f14618601f0>                  │ │
│ │         results = <generator object SnowflakeConnection.execute_stream at 0x7f14619a6dc0>    │ │
│ │            self = <snowcli.snow_connector.SnowflakeConnector object at 0x7f1461860370>       │ │
│ │ show_exceptions = True                                                                       │ │
│ │             sql = 'use role HOL_ROLE;\nuse warehouse HOL_WH;\nuse database HOL_DB;\nuse      │ │
│ │                   schema ANALYTI'+28                                                         │ │
│ │        template = <Template 'call_procedure.sql'>                                            │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowcli/snow_connector.py:660 in     │
│ runSql                                                                                           │
│                                                                                                  │
│   657 │   │   │   results = self.ctx.execute_stream(StringIO(sql))                               │
│   658 │   │   │                                                                                  │
│   659 │   │   │   # Return result from last cursor                                               │
│ ❱ 660 │   │   │   *_, last_result = results                                                      │
│   661 │   │   │   return last_result                                                             │
│   662 │   │   except snowflake.connector.errors.ProgrammingError as e:                           │
│   663 │   │   │   if show_exceptions:                                                            │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │         command = 'call_procedure'                                                           │ │
│ │         context = {                                                                          │ │
│ │                   │   'database': 'HOL_DB',                                                  │ │
│ │                   │   'schema': 'ANALYTICS',                                                 │ │
│ │                   │   'role': 'HOL_ROLE',                                                    │ │
│ │                   │   'warehouse': 'HOL_WH',                                                 │ │
│ │                   │   'procedure': 'orders_update_sp()'                                      │ │
│ │                   }                                                                          │ │
│ │             env = <jinja2.environment.Environment object at 0x7f14618601f0>                  │ │
│ │         results = <generator object SnowflakeConnection.execute_stream at 0x7f14619a6dc0>    │ │
│ │            self = <snowcli.snow_connector.SnowflakeConnector object at 0x7f1461860370>       │ │
│ │ show_exceptions = True                                                                       │ │
│ │             sql = 'use role HOL_ROLE;\nuse warehouse HOL_WH;\nuse database HOL_DB;\nuse      │ │
│ │                   schema ANALYTI'+28                                                         │ │
│ │        template = <Template 'call_procedure.sql'>                                            │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/connection.py:77 │
│ 6 in execute_stream                                                                              │
│                                                                                                  │
│    773 │   │   non_empty_statements = [e for e in split_statements_list if e[0]]                 │
│    774 │   │   for sql, is_put_or_get in non_empty_statements:                                   │
│    775 │   │   │   cur = self.cursor(cursor_class=cursor_class)                                  │
│ ❱  776 │   │   │   cur.execute(sql, _is_put_get=is_put_or_get, **kwargs)                         │
│    777 │   │   │   yield cur                                                                     │
│    778 │                                                                                         │
│    779 │   def __set_error_attributes(self) -> None:                                             │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │                   cur = <snowflake.connector.cursor.SnowflakeCursor object at                │ │
│ │                         0x7f146154bb20>                                                      │ │
│ │          cursor_class = <class 'snowflake.connector.cursor.SnowflakeCursor'>                 │ │
│ │         is_put_or_get = False                                                                │ │
│ │                kwargs = {}                                                                   │ │
│ │  non_empty_statements = [                                                                    │ │
│ │                         │   ('use role HOL_ROLE;', False),                                   │ │
│ │                         │   ('use warehouse HOL_WH;', False),                                │ │
│ │                         │   ('use database HOL_DB;', False),                                 │ │
│ │                         │   ('use schema ANALYTICS;', False),                                │ │
│ │                         │   ('call orders_update_sp();', False)                              │ │
│ │                         ]                                                                    │ │
│ │       remove_comments = False                                                                │ │
│ │                  self = <snowflake.connector.connection.SnowflakeConnection object at        │ │
│ │                         0x7f1461860400>                                                      │ │
│ │ split_statements_list = <generator object split_statements at 0x7f14619a75a0>                │ │
│ │                   sql = 'call orders_update_sp();'                                           │ │
│ │                stream = <_io.StringIO object at 0x7f1461506a70>                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/cursor.py:908 in │
│ execute                                                                                          │
│                                                                                                  │
│    905 │   │   │   │   code == "100072"
│    906 │   │   │   )  # NULL result in a non-nullable column                                     │
│    907 │   │   │   error_class = IntegrityError if is_integrity_error else ProgrammingError      │
│ ❱  908 │   │   │   Error.errorhandler_wrapper(self.connection, self, error_class, errvalue)      │
│    909 │   │   return self                                                                       │
│    910 │                                                                                         │
│    911 │   def execute_async(self, *args: Any, **kwargs: Any) -> dict[str, Any]:                 │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │                   _bind_stage = None                                                         │ │
│ │                _describe_only = False                                                        │ │
│ │                     _do_reset = True                                                         │ │
│ │                   _exec_async = False                                                        │ │
│ │          _force_put_overwrite = False                                                        │ │
│ │           _get_azure_callback = None                                                         │ │
│ │                 _get_callback = None                                                         │ │
│ │   _get_callback_output_stream = <_io.TextIOWrapper name='<stdout>' mode='w'                  │ │
│ │                                 encoding='utf-8'>                                            │ │
│ │                  _is_internal = False                                                        │ │
│ │                   _is_put_get = False                                                        │ │
│ │                   _no_results = False                                                        │ │
│ │                     _no_retry = False                                                        │ │
│ │           _put_azure_callback = None                                                         │ │
│ │                 _put_callback = None                                                         │ │
│ │   _put_callback_output_stream = <_io.TextIOWrapper name='<stdout>' mode='w'                  │ │
│ │                                 encoding='utf-8'>                                            │ │
│ │          _raise_put_get_error = True                                                         │ │
│ │            _show_progress_bar = True                                                         │ │
│ │ _skip_upload_on_content_match = False                                                        │ │
│ │             _statement_params = {}                                                           │ │
│ │                          code = '002140'                                                     │ │
│ │                       command = 'call orders_update_sp();'                                   │ │
│ │                           err = 'SQL compilation error:\nUnknown function ORDERS_UPDATE_SP'  │ │
│ │                   error_class = <class 'snowflake.connector.errors.ProgrammingError'>        │ │
│ │                      errvalue = {                                                            │ │
│ │                                 │   'msg': 'SQL compilation error:\nUnknown function         │ │
│ │                                 ORDERS_UPDATE_SP',                                           │ │
│ │                                 │   'errno': 2140,                                           │ │
│ │                                 │   'sqlstate': '42601',                                     │ │
│ │                                 │   'sfqid': '01b0ac6f-0001-2a64-0000-000121caa551',         │ │
│ │                                 │   'query': 'call orders_update_sp();',                     │ │
│ │                                 │   'done_format_msg': False                                 │ │
│ │                                 }                                                            │ │
│ │                   file_stream = None                                                         │ │
│ │            is_integrity_error = False                                                        │ │
│ │                        kwargs = {                                                            │ │
│ │                                 │   'timeout': None,                                         │ │
│ │                                 │   'statement_params': {},                                  │ │
│ │                                 │   'is_internal': False,                                    │ │
│ │                                 │   'describe_only': False,                                  │ │
│ │                                 │   '_no_results': False,                                    │ │
│ │                                 │   '_is_put_get': False,                                    │ │
│ │                                 │   '_no_retry': False                                       │ │
│ │                                 }                                                            │ │
│ │                             m = None                                                         │ │
│ │                num_statements = None                                                         │ │
│ │                        params = None                                                         │ │
│ │                         query = 'call orders_update_sp();'                                   │ │
│ │                           ret = {                                                            │ │
│ │                                 │   'data': {                                                │ │
│ │                                 │   │   'internalError': False,                              │ │
│ │                                 │   │   'errorCode': '002140',                               │ │
│ │                                 │   │   'age': 0,                                            │ │
│ │                                 │   │   'sqlState': '42601',                                 │ │
│ │                                 │   │   'queryId': '01b0ac6f-0001-2a64-0000-000121caa551',   │ │
│ │                                 │   │   'line': -1,                                          │ │
│ │                                 │   │   'pos': -1,                                           │ │
│ │                                 │   │   'type': 'COMPILATION'                                │ │
│ │                                 │   },                                                       │ │
│ │                                 │   'code': '002140',                                        │ │
│ │                                 │   'message': 'SQL compilation error:\nUnknown function     │ │
│ │                                 ORDERS_UPDATE_SP',                                           │ │
│ │                                 │   'success': False,                                        │ │
│ │                                 │   'headers': None                                          │ │
│ │                                 }                                                            │ │
│ │                          self = <snowflake.connector.cursor.SnowflakeCursor object at        │ │
│ │                                 0x7f146154bb20>                                              │ │
│ │                       timeout = None                                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/errors.py:290 in │
│ errorhandler_wrapper                                                                             │
│                                                                                                  │
│   287 │   │   │   exception to the first handler in that order.                                  │
│   288 │   │   """                                                                                │
│   289 │   │                                                                                      │
│ ❱ 290 │   │   handed_over = Error.hand_to_other_handler(                                         │
│   291 │   │   │   connection,                                                                    │
│   292 │   │   │   cursor,                                                                        │
│   293 │   │   │   error_class,                                                                   │
│                                                                                                  │
│ ╭────────────────────────────────────────── locals ───────────────────────────────────────────╮  │
│ │  connection = <snowflake.connector.connection.SnowflakeConnection object at 0x7f1461860400> │  │
│ │      cursor = <snowflake.connector.cursor.SnowflakeCursor object at 0x7f146154bb20>         │  │
│ │ error_class = <class 'snowflake.connector.errors.ProgrammingError'>                         │  │
│ │ error_value = {                                                                             │  │
│ │               │   'msg': 'SQL compilation error:\nUnknown function ORDERS_UPDATE_SP',       │  │
│ │               │   'errno': 2140,                                                            │  │
│ │               │   'sqlstate': '42601',                                                      │  │
│ │               │   'sfqid': '01b0ac6f-0001-2a64-0000-000121caa551',                          │  │
│ │               │   'query': 'call orders_update_sp();',                                      │  │
│ │               │   'done_format_msg': False                                                  │  │
│ │               }                                                                             │  │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯  │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/errors.py:345 in │
│ hand_to_other_handler                                                                            │
│                                                                                                  │
│   342 │   │   │   connection.messages.append((error_class, error_value))                         │
│   343 │   │   if cursor is not None:                                                             │
│   344 │   │   │   cursor.messages.append((error_class, error_value))                             │
│ ❱ 345 │   │   │   cursor.errorhandler(connection, cursor, error_class, error_value)              │
│   346 │   │   │   return True                                                                    │
│   347 │   │   elif connection is not None:                                                       │
│   348 │   │   │   connection.errorhandler(connection, cursor, error_class, error_value)          │
│                                                                                                  │
│ ╭────────────────────────────────────────── locals ───────────────────────────────────────────╮  │
│ │  connection = <snowflake.connector.connection.SnowflakeConnection object at 0x7f1461860400> │  │
│ │      cursor = <snowflake.connector.cursor.SnowflakeCursor object at 0x7f146154bb20>         │  │
│ │ error_class = <class 'snowflake.connector.errors.ProgrammingError'>                         │  │
│ │ error_value = {                                                                             │  │
│ │               │   'msg': 'SQL compilation error:\nUnknown function ORDERS_UPDATE_SP',       │  │
│ │               │   'errno': 2140,                                                            │  │
│ │               │   'sqlstate': '42601',                                                      │  │
│ │               │   'sfqid': '01b0ac6f-0001-2a64-0000-000121caa551',                          │  │
│ │               │   'query': 'call orders_update_sp();',                                      │  │
│ │               │   'done_format_msg': False                                                  │  │
│ │               }                                                                             │  │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯  │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/errors.py:221 in │
│ default_errorhandler                                                                             │
│                                                                                                  │
│   218 │   │   """
│   219 │   │   errno = error_value.get("errno")                                                   │
│   220 │   │   done_format_msg = error_value.get("done_format_msg")                               │
│ ❱ 221 │   │   raise error_class(                                                                 │
│   222 │   │   │   msg=error_value.get("msg"),                                                    │
│   223 │   │   │   errno=None if errno is None else int(errno),                                   │
│   224 │   │   │   sqlstate=error_value.get("sqlstate"),                                          │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │      connection = <snowflake.connector.connection.SnowflakeConnection object at              │ │
│ │                   0x7f1461860400>                                                            │ │
│ │          cursor = <snowflake.connector.cursor.SnowflakeCursor object at 0x7f146154bb20>      │ │
│ │ done_format_msg = False                                                                      │ │
│ │           errno = 2140                                                                       │ │
│ │     error_class = <class 'snowflake.connector.errors.ProgrammingError'>                      │ │
│ │     error_value = {                                                                          │ │
│ │                   │   'msg': 'SQL compilation error:\nUnknown function ORDERS_UPDATE_SP',    │ │
│ │                   │   'errno': 2140,                                                         │ │
│ │                   │   'sqlstate': '42601',                                                   │ │
│ │                   │   'sfqid': '01b0ac6f-0001-2a64-0000-000121caa551',                       │ │
│ │                   │   'query': 'call orders_update_sp();',                                   │ │
│ │                   │   'done_format_msg': False                                               │ │
│ │                   }                                                                          │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ProgrammingError: 002140 (42601): SQL compilation error:
Unknown function ORDERS_UPDATE_SP
(snowflake-demo) @nyck33 ➜ /workspaces/sfguide-data-engineering-with-snowpark-python/steps/05_fahrenheit_to_celsius_udf (main) $ cd ..
(snowflake-demo) @nyck33 ➜ /workspaces/sfguide-data-engineering-with-snowpark-python/steps (main) $ ls
01_setup_snowflake.sql  04_create_pos_view.py         07_daily_city_metrics_update_sp  10_deploy_via_cicd.sql
02_load_raw.py          05_fahrenheit_to_celsius_udf  08_orchestrate_jobs.sql          11_teardown.sql
03_load_weather.sql     06_orders_update_sp           09_process_incrementally.sql
(snowflake-demo) @nyck33 ➜ /workspaces/sfguide-data-engineering-with-snowpark-python/steps (main) $ cd 06_orders_update_sp
(snowflake-demo) @nyck33 ➜ /workspaces/sfguide-data-engineering-with-snowpark-python/steps/06_orders_update_sp (main) $ snow procedure execute -p "orders_update_sp()"
Error executing sql:
use role HOL_ROLE;
use warehouse HOL_WH;
use database HOL_DB;
use schema HARMONIZED;
call orders_update_sp();
100357 (P0000): Python Interpreter Error:
Traceback (most recent call last):
  File "/home/udf/18991632/app.zip/app.py", line 47, in main
    create_orders_table(session)
  File "/home/udf/18991632/app.zip/app.py", line 21, in create_orders_table
    _ = session.sql("CREATE TABLE HARMONIZED.ORDERS LIKE HARMONIZED.POS_FLATTENED_V").collect()
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/_internal/telemetry.py", line 139, in wrap
    result = func(*args, **kwargs)
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/dataframe.py", line 586, in collect
    return self._internal_collect_with_tag_no_telemetry(
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/dataframe.py", line 633, in _internal_collect_with_tag_no_telemetry
    return self._session._conn.execute(
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/_internal/server_connection.py", line 451, in execute
    result_set, result_meta = self.get_result_set(
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/_internal/analyzer/snowflake_plan.py", line 181, in wrap
    raise ne.with_traceback(tb) from None
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/_internal/analyzer/snowflake_plan.py", line 111, in wrap
    return func(*args, **kwargs)
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/_internal/server_connection.py", line 552, in get_result_set
    result = self.run_query(
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/_internal/server_connection.py", line 102, in wrap
    raise ex
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/_internal/server_connection.py", line 96, in wrap
    return func(*args, **kwargs)
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/_internal/server_connection.py", line 366, in run_query
    raise ex
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/snowpark/_internal/server_connection.py", line 347, in run_query
    results_cursor = self._cursor.execute(query, params=params, **kwargs)
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/connector/cursor.py", line 867, in execute
    Error.errorhandler_wrapper(
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/connector/errors.py", line 232, in errorhandler_wrapper
    handed_over = Error.hand_to_other_handler(
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/connector/errors.py", line 287, in hand_to_other_handler
    cursor.errorhandler(connection, cursor, error_class, error_value)
  File "/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowflake/connector/errors.py", line 165, in default_errorhandler
    raise error_class(
snowflake.snowpark.exceptions.SnowparkSQLException: (1304): 01b0ac6f-0001-2a64-0000-000121caa569: 002003 (42S02): SQL compilation error:
Object 'HOL_DB.HARMONIZED.POS_FLATTENED_V' does not exist or not authorized.
 in function ORDERS_UPDATE_SP with handler app.main
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowcli/cli/procedure.py:217 in      │
│ procedure_execute                                                                                │
│                                                                                                  │
│   214 │   │   help="Procedure with inputs. E.g. 'hello(int, string)'. Must exactly match those   │
│   215 │   ),                                                                                     │
│   216 ):                                                                                         │
│ ❱ 217 │   snowpark_execute("procedure", environment, select)                                     │
│   218                                                                                            │
│   219                                                                                            │
│   220 @app.command("describe")                                                                   │
│                                                                                                  │
│ ╭────────────── locals ──────────────╮                                                           │
│ │ environment = 'dev'                │                                                           │
│ │      select = 'orders_update_sp()' │                                                           │
│ ╰────────────────────────────────────╯                                                           │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowcli/cli/snowpark_shared.py:408   │
│ in snowpark_execute                                                                              │
│                                                                                                  │
│   405 │   │   │   │   warehouse=env_conf["warehouse"],                                           │
│   406 │   │   │   )                                                                              │
│   407 │   │   elif type == "procedure":                                                          │
│ ❱ 408 │   │   │   results = config.snowflake_connection.executeProcedure(                        │
│   409 │   │   │   │   procedure=select,                                                          │
│   410 │   │   │   │   database=env_conf["database"],                                             │
│   411 │   │   │   │   schema=env_conf["schema"],                                                 │
│                                                                                                  │
│ ╭───────────────── locals ──────────────────╮                                                    │
│ │    env_conf = {                           │                                                    │
│ │               │   'database': 'HOL_DB',   │                                                    │
│ │               │   'schema': 'HARMONIZED', │                                                    │
│ │               │   'warehouse': 'HOL_WH',  │                                                    │
│ │               │   'role': 'HOL_ROLE',     │                                                    │
│ │               │   'overwrite': True       │                                                    │
│ │               }                           │                                                    │
│ │ environment = 'dev'                       │                                                    │
│ │      select = 'orders_update_sp()'        │                                                    │
│ │        type = 'procedure'                 │                                                    │
│ ╰───────────────────────────────────────────╯                                                    │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowcli/snow_connector.py:179 in     │
│ executeProcedure                                                                                 │
│                                                                                                  │
│   176 │   │   role,                                                                              │
│   177 │   │   warehouse,                                                                         │
│   178 │   ) -> SnowflakeCursor:                                                                  │
│ ❱ 179 │   │   return self.runSql(                                                                │
│   180 │   │   │   "call_procedure",                                                              │
│   181 │   │   │   {                                                                              │
│   182 │   │   │   │   "database": database,                                                      │
│                                                                                                  │
│ ╭───────────────────────────────────── locals ─────────────────────────────────────╮             │
│ │  database = 'HOL_DB'                                                             │             │
│ │ procedure = 'orders_update_sp()'                                                 │             │
│ │      role = 'HOL_ROLE'                                                           │             │
│ │    schema = 'HARMONIZED'                                                         │             │
│ │      self = <snowcli.snow_connector.SnowflakeConnector object at 0x7fc9fa898370> │             │
│ │ warehouse = 'HOL_WH'                                                             │             │
│ ╰──────────────────────────────────────────────────────────────────────────────────╯             │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowcli/snow_connector.py:666 in     │
│ runSql                                                                                           │
│                                                                                                  │
│   663 │   │   │   if show_exceptions:                                                            │
│   664 │   │   │   │   print(f"Error executing sql:\n{sql}")                                      │
│   665 │   │   │   │   print(e)                                                                   │
│ ❱ 666 │   │   │   raise (e)                                                                      │
│   667 │                                                                                          │
│   668 │   def generate_signature_from_params(self, params: str) -> str:                          │
│   669 │   │   if params == "()":                                                                 │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │         command = 'call_procedure'                                                           │ │
│ │         context = {                                                                          │ │
│ │                   │   'database': 'HOL_DB',                                                  │ │
│ │                   │   'schema': 'HARMONIZED',                                                │ │
│ │                   │   'role': 'HOL_ROLE',                                                    │ │
│ │                   │   'warehouse': 'HOL_WH',                                                 │ │
│ │                   │   'procedure': 'orders_update_sp()'                                      │ │
│ │                   }                                                                          │ │
│ │             env = <jinja2.environment.Environment object at 0x7fc9fa8981f0>                  │ │
│ │         results = <generator object SnowflakeConnection.execute_stream at 0x7fc9fa7e2dc0>    │ │
│ │            self = <snowcli.snow_connector.SnowflakeConnector object at 0x7fc9fa898370>       │ │
│ │ show_exceptions = True                                                                       │ │
│ │             sql = 'use role HOL_ROLE;\nuse warehouse HOL_WH;\nuse database HOL_DB;\nuse      │ │
│ │                   schema HARMONI'+29                                                         │ │
│ │        template = <Template 'call_procedure.sql'>                                            │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowcli/snow_connector.py:660 in     │
│ runSql                                                                                           │
│                                                                                                  │
│   657 │   │   │   results = self.ctx.execute_stream(StringIO(sql))                               │
│   658 │   │   │                                                                                  │
│   659 │   │   │   # Return result from last cursor                                               │
│ ❱ 660 │   │   │   *_, last_result = results                                                      │
│   661 │   │   │   return last_result                                                             │
│   662 │   │   except snowflake.connector.errors.ProgrammingError as e:                           │
│   663 │   │   │   if show_exceptions:                                                            │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │         command = 'call_procedure'                                                           │ │
│ │         context = {                                                                          │ │
│ │                   │   'database': 'HOL_DB',                                                  │ │
│ │                   │   'schema': 'HARMONIZED',                                                │ │
│ │                   │   'role': 'HOL_ROLE',                                                    │ │
│ │                   │   'warehouse': 'HOL_WH',                                                 │ │
│ │                   │   'procedure': 'orders_update_sp()'                                      │ │
│ │                   }                                                                          │ │
│ │             env = <jinja2.environment.Environment object at 0x7fc9fa8981f0>                  │ │
│ │         results = <generator object SnowflakeConnection.execute_stream at 0x7fc9fa7e2dc0>    │ │
│ │            self = <snowcli.snow_connector.SnowflakeConnector object at 0x7fc9fa898370>       │ │
│ │ show_exceptions = True                                                                       │ │
│ │             sql = 'use role HOL_ROLE;\nuse warehouse HOL_WH;\nuse database HOL_DB;\nuse      │ │
│ │                   schema HARMONI'+29                                                         │ │
│ │        template = <Template 'call_procedure.sql'>                                            │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/connection.py:77 │
│ 6 in execute_stream                                                                              │
│                                                                                                  │
│    773 │   │   non_empty_statements = [e for e in split_statements_list if e[0]]                 │
│    774 │   │   for sql, is_put_or_get in non_empty_statements:                                   │
│    775 │   │   │   cur = self.cursor(cursor_class=cursor_class)                                  │
│ ❱  776 │   │   │   cur.execute(sql, _is_put_get=is_put_or_get, **kwargs)                         │
│    777 │   │   │   yield cur                                                                     │
│    778 │                                                                                         │
│    779 │   def __set_error_attributes(self) -> None:                                             │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │                   cur = <snowflake.connector.cursor.SnowflakeCursor object at                │ │
│ │                         0x7fc9fa3a3b20>                                                      │ │
│ │          cursor_class = <class 'snowflake.connector.cursor.SnowflakeCursor'>                 │ │
│ │         is_put_or_get = False                                                                │ │
│ │                kwargs = {}                                                                   │ │
│ │  non_empty_statements = [                                                                    │ │
│ │                         │   ('use role HOL_ROLE;', False),                                   │ │
│ │                         │   ('use warehouse HOL_WH;', False),                                │ │
│ │                         │   ('use database HOL_DB;', False),                                 │ │
│ │                         │   ('use schema HARMONIZED;', False),                               │ │
│ │                         │   ('call orders_update_sp();', False)                              │ │
│ │                         ]                                                                    │ │
│ │       remove_comments = False                                                                │ │
│ │                  self = <snowflake.connector.connection.SnowflakeConnection object at        │ │
│ │                         0x7fc9fa898400>                                                      │ │
│ │ split_statements_list = <generator object split_statements at 0x7fc9fa7e35a0>                │ │
│ │                   sql = 'call orders_update_sp();'                                           │ │
│ │                stream = <_io.StringIO object at 0x7fc9fa35e8c0>                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/cursor.py:908 in │
│ execute                                                                                          │
│                                                                                                  │
│    905 │   │   │   │   code == "100072"
│    906 │   │   │   )  # NULL result in a non-nullable column                                     │
│    907 │   │   │   error_class = IntegrityError if is_integrity_error else ProgrammingError      │
│ ❱  908 │   │   │   Error.errorhandler_wrapper(self.connection, self, error_class, errvalue)      │
│    909 │   │   return self                                                                       │
│    910 │                                                                                         │
│    911 │   def execute_async(self, *args: Any, **kwargs: Any) -> dict[str, Any]:                 │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │                   _bind_stage = None                                                         │ │
│ │                _describe_only = False                                                        │ │
│ │                     _do_reset = True                                                         │ │
│ │                   _exec_async = False                                                        │ │
│ │          _force_put_overwrite = False                                                        │ │
│ │           _get_azure_callback = None                                                         │ │
│ │                 _get_callback = None                                                         │ │
│ │   _get_callback_output_stream = <_io.TextIOWrapper name='<stdout>' mode='w'                  │ │
│ │                                 encoding='utf-8'>                                            │ │
│ │                  _is_internal = False                                                        │ │
│ │                   _is_put_get = False                                                        │ │
│ │                   _no_results = False                                                        │ │
│ │                     _no_retry = False                                                        │ │
│ │           _put_azure_callback = None                                                         │ │
│ │                 _put_callback = None                                                         │ │
│ │   _put_callback_output_stream = <_io.TextIOWrapper name='<stdout>' mode='w'                  │ │
│ │                                 encoding='utf-8'>                                            │ │
│ │          _raise_put_get_error = True                                                         │ │
│ │            _show_progress_bar = True                                                         │ │
│ │ _skip_upload_on_content_match = False                                                        │ │
│ │             _statement_params = {}                                                           │ │
│ │                          code = '100357'                                                     │ │
│ │                       command = 'call orders_update_sp();'                                   │ │
│ │                           err = 'Python Interpreter Error:\nTraceback (most recent call      │ │
│ │                                 last):\n  File "/home/udf/1'+3969                            │ │
│ │                   error_class = <class 'snowflake.connector.errors.ProgrammingError'>        │ │
│ │                      errvalue = {                                                            │ │
│ │                                 │   'msg': 'Python Interpreter Error:\nTraceback (most       │ │
│ │                                 recent call last):\n  File "/home/udf/1'+3969,               │ │
│ │                                 │   'errno': 100357,                                         │ │
│ │                                 │   'sqlstate': 'P0000',                                     │ │
│ │                                 │   'sfqid': '01b0ac6f-0001-2a64-0000-000121caa55d',         │ │
│ │                                 │   'query': 'call orders_update_sp();',                     │ │
│ │                                 │   'done_format_msg': False                                 │ │
│ │                                 }                                                            │ │
│ │                   file_stream = None                                                         │ │
│ │            is_integrity_error = False                                                        │ │
│ │                        kwargs = {                                                            │ │
│ │                                 │   'timeout': None,                                         │ │
│ │                                 │   'statement_params': {},                                  │ │
│ │                                 │   'is_internal': False,                                    │ │
│ │                                 │   'describe_only': False,                                  │ │
│ │                                 │   '_no_results': False,                                    │ │
│ │                                 │   '_is_put_get': False,                                    │ │
│ │                                 │   '_no_retry': False                                       │ │
│ │                                 }                                                            │ │
│ │                             m = None                                                         │ │
│ │                num_statements = None                                                         │ │
│ │                        params = None                                                         │ │
│ │                         query = 'call orders_update_sp();'                                   │ │
│ │                           ret = {                                                            │ │
│ │                                 │   'data': {                                                │ │
│ │                                 │   │   'internalError': False,                              │ │
│ │                                 │   │   'errorCode': '100357',                               │ │
│ │                                 │   │   'age': 0,                                            │ │
│ │                                 │   │   'sqlState': 'P0000',                                 │ │
│ │                                 │   │   'queryId': '01b0ac6f-0001-2a64-0000-000121caa55d'    │ │
│ │                                 │   },                                                       │ │
│ │                                 │   'code': '100357',                                        │ │
│ │                                 │   'message': 'Python Interpreter Error:\nTraceback (most   │ │
│ │                                 recent call last):\n  File "/home/udf/1'+3969,               │ │
│ │                                 │   'success': False,                                        │ │
│ │                                 │   'headers': None                                          │ │
│ │                                 }                                                            │ │
│ │                          self = <snowflake.connector.cursor.SnowflakeCursor object at        │ │
│ │                                 0x7fc9fa3a3b20>                                              │ │
│ │                       timeout = None                                                         │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/errors.py:290 in │
│ errorhandler_wrapper                                                                             │
│                                                                                                  │
│   287 │   │   │   exception to the first handler in that order.                                  │
│   288 │   │   """                                                                                │
│   289 │   │                                                                                      │
│ ❱ 290 │   │   handed_over = Error.hand_to_other_handler(                                         │
│   291 │   │   │   connection,                                                                    │
│   292 │   │   │   cursor,                                                                        │
│   293 │   │   │   error_class,                                                                   │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │  connection = <snowflake.connector.connection.SnowflakeConnection object at 0x7fc9fa898400>  │ │
│ │      cursor = <snowflake.connector.cursor.SnowflakeCursor object at 0x7fc9fa3a3b20>          │ │
│ │ error_class = <class 'snowflake.connector.errors.ProgrammingError'>                          │ │
│ │ error_value = {                                                                              │ │
│ │               │   'msg': 'Python Interpreter Error:\nTraceback (most recent call last):\n    │ │
│ │               File "/home/udf/1'+3969,                                                       │ │
│ │               │   'errno': 100357,                                                           │ │
│ │               │   'sqlstate': 'P0000',                                                       │ │
│ │               │   'sfqid': '01b0ac6f-0001-2a64-0000-000121caa55d',                           │ │
│ │               │   'query': 'call orders_update_sp();',                                       │ │
│ │               │   'done_format_msg': False                                                   │ │
│ │               }                                                                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/errors.py:345 in │
│ hand_to_other_handler                                                                            │
│                                                                                                  │
│   342 │   │   │   connection.messages.append((error_class, error_value))                         │
│   343 │   │   if cursor is not None:                                                             │
│   344 │   │   │   cursor.messages.append((error_class, error_value))                             │
│ ❱ 345 │   │   │   cursor.errorhandler(connection, cursor, error_class, error_value)              │
│   346 │   │   │   return True                                                                    │
│   347 │   │   elif connection is not None:                                                       │
│   348 │   │   │   connection.errorhandler(connection, cursor, error_class, error_value)          │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │  connection = <snowflake.connector.connection.SnowflakeConnection object at 0x7fc9fa898400>  │ │
│ │      cursor = <snowflake.connector.cursor.SnowflakeCursor object at 0x7fc9fa3a3b20>          │ │
│ │ error_class = <class 'snowflake.connector.errors.ProgrammingError'>                          │ │
│ │ error_value = {                                                                              │ │
│ │               │   'msg': 'Python Interpreter Error:\nTraceback (most recent call last):\n    │ │
│ │               File "/home/udf/1'+3969,                                                       │ │
│ │               │   'errno': 100357,                                                           │ │
│ │               │   'sqlstate': 'P0000',                                                       │ │
│ │               │   'sfqid': '01b0ac6f-0001-2a64-0000-000121caa55d',                           │ │
│ │               │   'query': 'call orders_update_sp();',                                       │ │
│ │               │   'done_format_msg': False                                                   │ │
│ │               }                                                                              │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/errors.py:221 in │
│ default_errorhandler                                                                             │
│                                                                                                  │
│   218 │   │   """                                                                                │
│   219 │   │   errno = error_value.get("errno")                                                   │
│   220 │   │   done_format_msg = error_value.get("done_format_msg")                               │
│ ❱ 221 │   │   raise error_class(                                                                 │
│   222 │   │   │   msg=error_value.get("msg"),                                                    │
│   223 │   │   │   errno=None if errno is None else int(errno),                                   │
│   224 │   │   │   sqlstate=error_value.get("sqlstate"),                                          │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │      connection = <snowflake.connector.connection.SnowflakeConnection object at              │ │
│ │                   0x7fc9fa898400>                                                            │ │
│ │          cursor = <snowflake.connector.cursor.SnowflakeCursor object at 0x7fc9fa3a3b20>      │ │
│ │ done_format_msg = False                                                                      │ │
│ │           errno = 100357                                                                     │ │
│ │     error_class = <class 'snowflake.connector.errors.ProgrammingError'>                      │ │
│ │     error_value = {                                                                          │ │
│ │                   │   'msg': 'Python Interpreter Error:\nTraceback (most recent call         │ │
│ │                   last):\n  File "/home/udf/1'+3969,                                         │ │
│ │                   │   'errno': 100357,                                                       │ │
│ │                   │   'sqlstate': 'P0000',                                                   │ │
│ │                   │   'sfqid': '01b0ac6f-0001-2a64-0000-000121caa55d',                       │ │
│ │                   │   'query': 'call orders_update_sp();',                                   │ │
│ │                   │   'done_format_msg': False                                               │ │
│ │                   }                                                                          │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ProgrammingError: 100357 (P0000): Python Interpreter Error:
Traceback (most recent call last):
  File "/home/udf/18991632/app.zip/app.py", line 47, in main
    create_orders_table(session)
  File "/home/udf/18991632/app.zip/app.py", line 21, in create_orders_table
    _ = session.sql("CREATE TABLE HARMONIZED.ORDERS LIKE HARMONIZED.POS_FLATTENED_V").collect()
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/_internal/telemetry.py", line 139, in wrap
    result = func(*args, **kwargs)
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/dataframe.py", line 586, in collect
    return self._internal_collect_with_tag_no_telemetry(
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/dataframe.py", line 633, in _internal_collect_with_tag_no_telemetry
    return self._session._conn.execute(
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/_internal/server_connection.py", line 451, in execute
    result_set, result_meta = self.get_result_set(
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/_internal/analyzer/snowflake_plan.py", line 181, in wrap
    raise ne.with_traceback(tb) from None
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/_internal/analyzer/snowflake_plan.py", line 111, in wrap
    return func(*args, **kwargs)
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/_internal/server_connection.py", line 552, in get_result_set
    result = self.run_query(
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/_internal/server_connection.py", line 102, in wrap
    raise ex
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/_internal/server_connection.py", line 96, in wrap
    return func(*args, **kwargs)
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/_internal/server_connection.py", line 366, in run_query
    raise ex
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/snowpark/_internal/server_connection.py", line 347, in run_query
    results_cursor = self._cursor.execute(query, params=params, **kwargs)
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/connector/cursor.py", line 867, in execute
    Error.errorhandler_wrapper(
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/connector/errors.py", line 232, in errorhandler_wrapper
    handed_over = Error.hand_to_other_handler(
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/connector/errors.py", line 287, in hand_to_other_handler
    cursor.errorhandler(connection, cursor, error_class, error_value)
  File 
"/usr/lib/python_udf/1ffa8b97b173d13a75954c71a802ce7a006594e2ba885538acd15cbc79361324/lib/python3.8/site-packages/snowf
lake/connector/errors.py", line 165, in default_errorhandler
    raise error_class(
snowflake.snowpark.exceptions.SnowparkSQLException: (1304): 01b0ac6f-0001-2a64-0000-000121caa569: 002003 (42S02): SQL 
compilation error:
Object 'HOL_DB.HARMONIZED.POS_FLATTENED_V' does not exist or not authorized.
 in function ORDERS_UPDATE_SP with handler app.main
(snowflake-demo) @nyck33 ➜ /workspaces/sfguide-data-engineering-with-snowpark-python/steps/06_orders_update_sp (main) $ python app.py
Traceback (most recent call last):
  File "/workspaces/sfguide-data-engineering-with-snowpark-python/steps/06_orders_update_sp/app.py", line 72, in <module>
    print(main(session))  # type: ignore
  File "/workspaces/sfguide-data-engineering-with-snowpark-python/steps/06_orders_update_sp/app.py", line 51, in main
    merge_order_updates(session)
  File "/workspaces/sfguide-data-engineering-with-snowpark-python/steps/06_orders_update_sp/app.py", line 39, in merge_order_updates
    target.merge(source, target['ORDER_DETAIL_ID'] == source['ORDER_DETAIL_ID'], \
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/table.py", line 641, in merge
    result = new_df._internal_collect_with_tag(
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/_internal/telemetry.py", line 139, in wrap
    result = func(*args, **kwargs)
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/dataframe.py", line 633, in _internal_collect_with_tag_no_telemetry
    return self._session._conn.execute(
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/_internal/server_connection.py", line 451, in execute
    result_set, result_meta = self.get_result_set(
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/_internal/analyzer/snowflake_plan.py", line 181, in wrap
    raise ne.with_traceback(tb) from None
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/_internal/analyzer/snowflake_plan.py", line 111, in wrap
    return func(*args, **kwargs)
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/_internal/server_connection.py", line 552, in get_result_set
    result = self.run_query(
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/_internal/server_connection.py", line 102, in wrap
    raise ex
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/_internal/server_connection.py", line 96, in wrap
    return func(*args, **kwargs)
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/_internal/server_connection.py", line 366, in run_query
    raise ex
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/snowpark/_internal/server_connection.py", line 347, in run_query
    results_cursor = self._cursor.execute(query, params=params, **kwargs)
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/cursor.py", line 908, in execute
    Error.errorhandler_wrapper(self.connection, self, error_class, errvalue)
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/errors.py", line 290, in errorhandler_wrapper
    handed_over = Error.hand_to_other_handler(
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/errors.py", line 345, in hand_to_other_handler
    cursor.errorhandler(connection, cursor, error_class, error_value)
  File "/opt/conda/envs/snowflake-demo/lib/python3.10/site-packages/snowflake/connector/errors.py", line 221, in default_errorhandler
    raise error_class(
snowflake.snowpark.exceptions.SnowparkSQLException: (1304): 100090 (42P18): Duplicate row detected during DML action
Row Values: [437552392, 61, 1611566566000000000, 18652, 844859897, 0, "Freezing Point", "Ice Cream", "New York City", "New York", "United States", 1, 49, "Bruce", "Kent", 15162, 11, "Sugar Cone", 1, 60000, 60000, 520000, NULL, NULL, 520000, 1701311173737000000]
(snowflake-demo) @nyck33 ➜ /workspaces/sfguide-data-engineering-with-snowpark-python/steps/06_orders_update_sp (main) $ 

Then on Snowsight:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment