CREATE EXTERNAL TABLE with filepath() or filename() calculated column gives syntax error
还没有人认领这个 Issue。
评估
调研方向
使用提供的包含 filepath() 和 filename() 的 CREATE EXTERNAL TABLE 语句作为复现用例,并首先通过 ScriptDOM 解析器运行它,以确认语法错误是在哪里报告的。检查解析器和语法对外部表中计算列的支持情况,然后添加回归测试覆盖,以证明有效的 SQL 可以成功解析。
由索引模型根据 Issue 内容生成。
描述
CREATE EXTERNAL TABLE [stg].[my_table] (
[COLUMN_ONE] VARCHAR (50) NULL,
[filepath] AS CAST(filepath() AS NVARCHAR(1024)),
[filename] AS CAST(filename() AS NVARCHAR(1024))
)
WITH (
DATA_SOURCE = [DataSource1],
LOCATION = N'somepath/somefile*.csv',
FILE_FORMAT = [TildeDelimitedQuoted_CSV],
REJECT_TYPE = VALUE,
REJECT_VALUE = 0
);
The above is valid and runs in SQL Managed Instance but in VS 2022 with latest updates I get
Incorrect Syntax near 'AS'
This is a problem for us and we are having to revert to using views with OPENQUERY rather than external tables as we need the filepath and filename in the external table resultset.
I hope this is the right place to raise this !
- 主要语言
- GAP
- 星标
- 277
- 派生
- 43
- 平均合并
- 6 天 17 小时
- 30 天内合并 PR
- 3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/SqlScriptDOM 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
microsoft/SqlScriptDOM#228 ·
-
难度 2/5 1-3 小时 新手友好度 62/100
microsoft/SqlScriptDOM#183 ·
-
难度 4/5 3-5 天 新手友好度 56/100
microsoft/SqlScriptDOM#226 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 48/100
microsoft/SqlScriptDOM#225 ·
-
难度 3/5 1-2 天 新手友好度 58/100
microsoft/SqlScriptDOM#224 ·
查看 microsoft/SqlScriptDOM 的全部 Issue
相似的 Issue
-
flang:fir-hlfir
难度 2/5 1-3 小时 新手友好度 70/100
llvm/llvm-project#225935 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
objectionary/eo#8923 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
Coarray integration tests carry no LABELS, so run_tests.py silently skips them under every backend 未关闭coarray
难度 2/5 1-3 小时 新手友好度 70/100