【问题标题】:Azure Datalake Gen2 as external table for Azure Data ExplorerAzure Datalake Gen2 作为 Azure 数据资源管理器的外部表
【发布时间】:2023-03-29 00:39:01
【问题描述】:

我们在 Azure Data Lake Gen 2 中的分区文件夹下有 CSV 文件,因此单个大表将有多个 CSV 文件。我们希望通过创建外部表在 Azure 数据资源管理器中使用这些文件。所以我使用下面的脚本在 ADX 中创建一个外部表:

   .create external table TestAdx
(

    id: int,
    name: string,
    designation: string
)
kind=adl

dataformat=csv

(
    h@'abfss://containername@storageaccountname.dfs.core.windows.net/staging/textadx;token=<<generating using .net API>>'
)

with 
(
   docstring = "Docs",
   folder = "ExternalTables",
   namePrefix="Prefix"
)

我能够执行这个查询并创建了外部表,但是当我尝试从这个表中获取数据时,它给出了以下错误:

语义错误:“TestAdx”有以下语义错误:“” 运算符:无法解析名为的表或列或标量表达式 'TestAdx'。​​

另外请告诉我这是处理 ADLS Gen2 文件形式 ADX 的正确方法吗?

【问题讨论】:

    标签: azure azure-data-lake azure-databricks azure-data-explorer


    【解决方案1】:

    您正在运行的查询是什么?你在使用external_table() 函数吗?

    【讨论】:

    • 对不起,我错过了使用 external_table() 函数。思想令牌对我不起作用,我使用了 AccessKey 机制。
    【解决方案2】:

    您需要使用external_table("TestAdx") 访问外部表。

    【讨论】:

      【解决方案3】:

      以下是使用 Azure Data Lake Gen 2 使用 Azure Data Explorer 创建外部表的示例。我添加了分区键和其他参数。

      .create external table BugsCSV
      (
          Column1 : string,
          Column2 : string,
          Column3 : string
      )
      kind=adl
      partition by "State="State
      dataformat=csv
      (
          h@'abfss://containername@storageaccountname.dfs.core.windows.net/path;key'
      )
      with
      (
          docstring = "Docs",
          folder = "ExternalTables",
          compressed=true,   
          compressiontype="lz4"
      )
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-11-14
        • 2021-05-19
        • 2019-09-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多