TableToArrowTable

Resumen

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

Debate

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.

Sintaxis

TableToArrowTable (in_table, {field_names}, {where_clause}, {geometry_encoding})
ParámetroExplicaciónTipo de datos
in_table

La clase de entidad, capa, tabla o vista de tabla.

String
field_names
[field_names,...]

Una lista (o tupla) de nombres de campo. Para un único campo, puede utilizar una cadena en lugar de una lista de cadenas.

(El valor predeterminado es "")

String
where_clause

Una expresión opcional que limita los registros que se devuelven. Para obtener más información sobre cláusulas WHERE y sentencias SQL, consulte Referencia de SQL para las expresiones de consulta utilizadas en ArcGIS.

(El valor predeterminado es "")

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
Nota:

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.

(El valor predeterminado es ESRISHAPE)

String
Valor de retorno
Tipo de datosExplicación
PyArrowTable

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

Muestra de código

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")

Temas relacionados