Skip to content

Fix copy into macro when passing expression_list.#223

Merged
ueshin merged 2 commits into
databricks:mainfrom
ueshin:copy_into
Nov 2, 2022
Merged

Fix copy into macro when passing expression_list.#223
ueshin merged 2 commits into
databricks:mainfrom
ueshin:copy_into

Conversation

@ueshin
Copy link
Copy Markdown
Contributor

@ueshin ueshin commented Nov 2, 2022

Description

Fixes copy into macro when passing expression_list.

Encountered an error while running operation: Runtime Error
  Runtime Error

    [PARSE_SYNTAX_ERROR] Syntax error at or near 'select'(line 5, pos 9)

    == SQL ==
    /* ... */


        copy into test16673467754364144015_copy_into.target_with_expression_list
        from select id, name from '/path/to/source'
    ---------^^^
        fileformat = parquet


        format_options ('mergeSchema' = 'true')
        copy_options ('mergeSchema' = 'true')

There should be parenthesis surrounding select id, name from '/path/to/source'.

Copy link
Copy Markdown
Collaborator

@allisonwang-db allisonwang-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

@ueshin
Copy link
Copy Markdown
Contributor Author

ueshin commented Nov 2, 2022

Thanks! merging.

@ueshin ueshin merged commit 7718e7e into databricks:main Nov 2, 2022
@ueshin ueshin deleted the copy_into branch November 2, 2022 18:21
ueshin added a commit that referenced this pull request Nov 2, 2022
### Description

Fixes copy into macro when passing `expression_list`.

```
Encountered an error while running operation: Runtime Error
  Runtime Error

    [PARSE_SYNTAX_ERROR] Syntax error at or near 'select'(line 5, pos 9)

    == SQL ==
    /* ... */

        copy into test16673467754364144015_copy_into.target_with_expression_list
        from select id, name from '/path/to/source'
    ---------^^^
        fileformat = parquet

        format_options ('mergeSchema' = 'true')
        copy_options ('mergeSchema' = 'true')
```

There should be parenthesis surrounding `select id, name from '/path/to/source'`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants