AWS Glue 数据目录表列的“参数”字段是什么?

问题描述 投票:0回答:1

Glue 数据目录表的 AWS 文档指出,一列有四个字段:

  • 姓名
  • 类型
  • 评论
  • 参数

前三个很容易理解;这是我的 CloudFormation 模板的摘录:


# . . . the full table definition has been elided . . .

StorageDescriptor:
    Columns:
        - { Name: id, Type: string, Comment: "A unique key; UUIDv4" }

但是,我不清楚Parameters应该用来做什么。

https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-catalog-tables.html#aws-glue-api-catalog-tables-Column

我已复制并粘贴以下有问题的文档部分:

Column structure
    A column in a Table.

Fields

    Name
        - Required: UTF-8 string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern.
        - The name of the Column. 

    Type
        – UTF-8 string, not more than 131072 bytes long, matching the Single-line string pattern.
        - The data type of the Column.

    Comment
        – Comment string, not more than 255 bytes long, matching the Single-line string pattern.
        - A free-form text comment.

    Parameters
        – A map array of key-value pairs. Each key is a Key string, not less than 1 or more than 255 bytes long, matching the Single-line string pattern. Each value is a UTF-8 string, not more than 512000 bytes long. These key-value pairs define properties associated with the column.

但是,Parameters 未出现在此处提供的 CloudFormation 文档中:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-glue-table-column.html

问题:

  1. 什么是参数
  2. 它们是否记录在任何地方?
  3. 您能举个例子吗?
  4. 我应该在参数中包含什么,为什么这是一个好主意?
amazon-web-services pyspark aws-cloudformation aws-glue parquet
1个回答
0
投票

参数字段对于存储有关名称、类型或注释字段未捕获的列的附加元数据非常有用

因此您可以使用它来定义与表中的列关联的属性

AWS Glue 文档提供了由 AWS Glue 爬网程序设置的参数列表。你可以在这里

列出这个列表

这些参数包括:

  • 分类:数据的格式,由爬虫推断。
  • compressionType:表中数据使用的压缩类型。
  • objectCount:表的 Amazon S3 路径下的对象数量。
  • recordCount:根据文件大小估计表中的记录数 和标题。
  • sizeKey:爬取表中文件的总大小。
  • typeOfData:文件、表或视图。

例如,如果名为 my_table 的表中有一个名为 data 的列,则可以将该数据列的 typeOfData 参数设置为 file(如果该列包含文件数据)、table(如果该列包含表数据)或 view(如果该列包含查看数据1.

© www.soinside.com 2019 - 2024. All rights reserved.