Zusammenfassung
The TableToArrowTable function converts a table or feature class to an Apache Arrow table.
Diskussion
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.
Syntax
TableToArrowTable (in_table, {field_names}, {where_clause}, {geometry_encoding})| Parameter | Erläuterung | Datentyp |
in_table | Die Feature-Class, der Layer, die Tabelle oder die Tabellensicht | String |
field_names [field_names,...] | Eine Liste (oder ein Tupel) von Feldnamen. Für ein einzelnes Feld kann eine Zeichenfolge statt einer Zeichenfolgenliste verwendet werden. (Der Standardwert ist "") | String |
where_clause | Ein optionaler Ausdruck zur Begrenzung der zurückgegebenen Datensätze. Weitere Informationen zu WHERE-Klauseln und SQL-Anweisungen finden Sie unter SQL-Referenz für in ArcGIS verwendete Abfrageausdrücke. (Der Standardwert ist "") | String |
geometry_encoding | Specifies the geometry encoding of the geometry column in the resulting Arrow table.
Hinweis: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. (Der Standardwert ist ESRISHAPE) | String |
| Datentyp | Erläuterung |
| PyArrowTable | The output pyarrow.Table. See the pyarrow.Table object API. |
Codebeispiel
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}")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")