TableToArrowTable

サマリー

The TableToArrowTable function converts a table or feature class to an Apache Arrow table.

説明

Apache Arrow is a standard cross-platform in-memory representation of columnar data used to efficiently transport data between analytics systems for big data. For more information, see Apache Arrow in ArcGIS.

構文

TableToArrowTable (in_table, {field_names}, {where_clause}, {geometry_encoding})
パラメーター説明データ タイプ
in_table

フィーチャクラス、レイヤー、テーブル、またはテーブル ビュー。

String
field_names
[field_names,...]

フィールド名のリスト (またはタプル)。 単一フィールドの場合、文字列のリストの代わりに文字列を使用できます。

(デフォルト値は次のとおりです "")

String
where_clause

返されるレコードを制限するオプションの式。 WHERE 句と SQL ステートメントの詳細については、「ArcGIS で使用されるクエリ式への SQL リファレンス」をご参照ください。

(デフォルト値は次のとおりです "")

String
geometry_encoding

Specifies the geometry encoding of the geometry column in the resulting Arrow table.

  • ESRISHAPENative binary geometry encoding
  • ESRIJSONNative JSON format geometry encoding
  • GEOJSONOpen standard JSON format geometry encoding.
  • WKTWell-known text (WKT) geometry encoding.
  • WKBWell-known binary (WKB) geometry encoding
注意:

If no geometry field is specified in the field_names argument or the in_table value is a non-spatial table, this argument will be ignored. In both cases, the resulting Arrow table will not contain a geometry column.

(デフォルト値は次のとおりです ESRISHAPE)

String
戻り値
データ タイプ説明
PyArrowTable

The output pyarrow.Table. See the pyarrow.Table object API.

コードのサンプル

TableToArrowTable example 1

Convert a feature class to an Arrow table and count the number of counties in the dataset.

import arcpy

input = r'C:\data\usa.gdb\USA\counties'
arrow_table = arcpy.da.TableToArrowTable(input)

# Get the number of counties in the dataset
count = arcpy.management.GetCount(arrow_table)
print(f"Number of US Counties: {count}")
TableToArrowTable example 2

Convert a feature class to an Arrow table with the WKT geometry encoding.

import arcpy

input = r'C:\data\usa.gdb\USA\counties'
arrow_table = arcpy.da.TableToArrowTable(input, geometry_encoding="WKT")

関連トピック


このトピックの内容