⌘K ctrl+k
Search Shortcut cmd + k | ctrl + k
DuckDB 2.0 ドキュメント 全文検索
per page, with , order by , clip by
Results of 1 - 10 of about 30 for Arrays (0.002 sec.)
Array Functions 15287
All LIST functions work with the ARRAY data type . Additionally, several ARRAY -native functions are also supported. Array-Native Functions Function Description array_cosine_distance(array1, array2) Computes the cosine distance between two ... arrays of the same size. The array elements cannot be NULL . The arrays can have any size as long as the size is the same for both arguments. array_cosine_similarity(array1, array2) Computes the ... cosine similarity between two arrays of the same size. The array elements cannot be NULL . The arrays can have any size as long as the size is the same for bot ... h arguments. array_cross_product(array, array) Computes the cross product of two arrays of size 3. The array elements cannot be NULL . array_distance(array1, array2) Computes the distance between two arrays of ...
https://man.mtool.work/duckdb/2.0/sql/functions/array.html
Array Type 12379
An ARRAY column stores fixed-sized arrays. All fields in the column must have the same length and the same underlying type. Arrays are typically used to store arrays of numbers, but can contain any uniform data type, including ARRAY , LIST ... and STRUCT types. Arrays can be used to store vectors such as word embeddings or image embeddings. To store variable-length lists, use the LIST typ ... sted data types. The ARRAY type in PostgreSQL allows variable-length fields. DuckDB's ARRAY type is fixed-length. Creating Arrays Arrays can be created using the array_value(expr, ...) function . Construct with the array_value function: SELECT array_va ... rray_value(1, 2, 3)[2]; You can cast from a list to an array (the dimensions have to match): SELECT [3, 2, 1]::INTEGER[3]; Arrays can be nested: SELECT array_value(array_value(1, 2), array_value(3, 4), array_value(5, 6)); Arrays can store structs: SELE ...
https://man.mtool.work/duckdb/2.0/sql/data_types/array.html
Data Ingestion 8805
This page contains examples for data ingestion to Python using DuckDB. First, import the DuckDB package: import duckdb Then, proceed with any of the following sections. CSV Files CSV files can be read using the read_csv function, called eit ... , (2, 'two'), (3, 'three'), (4, 'four')] The same works for Pandas Series, Polars DataFrames, LazyFrames and Series, NumPy arrays, a dict of one-dimensional NumPy arrays, relations and Arrow objects. The masked elements in a NumPy masked array are NULL ... . In a dict of arrays, names that differ only in case get a suffix, so the keys a and A become the columns a and A_1 . Use register() to give a ... views Replacement scans DuckDB supports querying multiple types of Apache Arrow objects including tables , record batches, arrays and chunked arrays, datasets , RecordBatchReaders and scanners . See the Python guides for more examples. The filters of a ...
https://man.mtool.work/duckdb/2.0/clients/python/data_ingestion.html
Import from Numpy 8626
It is possible to query Numpy arrays from DuckDB. There is no need to register the arrays manually – DuckDB can find them in the Python process by name thanks to replacement scans . For example: import duckdb import numpy as np columns = { ... e": np.array([9.0, 8.0, 7.0]), } print(duckdb.sql("SELECT * FROM columns").fetchall()) [(1, 9.0), (2, 8.0), (3, 7.0)] Each array supplies one column. DuckDB also accepts a two-dimensional array, treating each outer array as a column. Transpose an array ...
https://man.mtool.work/duckdb/2.0/guides/python/import_numpy.html
Typecasting 8382
Typecasting is an operation that converts a value in one particular data type to the closest corresponding value in another data type. Like other SQL engines, DuckDB supports both implicit and explicit typecasting. Explicit Casting Explicit ... literals (such as 'string' ) have special implicit casting rules. See the literal types page for more information. Lists / Arrays Lists can be explicitly cast to other lists using the same casting rules. The cast is applied to the children of the list. ... hild INTEGER elements are individually cast to VARCHAR and a new list is constructed. SELECT CAST([1, 2, 3] AS VARCHAR[]); Arrays Arrays follow the same casting rules as lists. In addition, arrays can be implicitly cast to lists of the same type. For e ...
https://man.mtool.work/duckdb/2.0/sql/data_types/typecasting.html
JSON Format Settings 8139
The JSON extension can attempt to determine the format of a JSON file when setting format to auto . Here are some example JSON files and the corresponding format settings that should be used. In each of the below cases, the format setting w ... alue2, 'key2': value2} {'key1': value3, 'key2': value3} This is especially useful if we have non-object JSON, for example, arrays.json : [1, 2, 3] [4, 5, 6] [7, 8, 9] SELECT * FROM read_json('arrays.json', records = false); json [1, 2, 3] [4, 5, 6] [7, ...
https://man.mtool.work/duckdb/2.0/data/json/format_settings.html
JSON Overview 8139
DuckDB supports SQL functions that are useful for reading values from existing JSON and creating new JSON data. JSON is supported with the json extension which is shipped with most DuckDB distributions and is auto-loaded on first use. If yo ... nterchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other serializable values). While it is not a very efficient format for tabular data, it is very commonly used, especi ... Note that DuckDB only supports lookups in JSONPath, i.e., extracting fields with .<key> or array elements with [<index>] . Arrays can be indexed from the back and both approaches support the wildcard * . DuckDB does not support the full JSONPath syntax ...
https://man.mtool.work/duckdb/2.0/data/json/overview.html
Vectors 8009
Vectors represent a horizontal slice of a column. They hold a number of values of a specific type, similar to an array. Vectors are the core data representation used in DuckDB. Vectors are typically stored within data chunks . The vector an ... mance. However, the interfaces are also difficult to use and care must be taken when using them. Vector Format Vectors are arrays of a specific data type. The logical type of a vector can be obtained using duckdb_vector_get_column_type . The type id of ... entries itself and any children stored in the lists can also be NULL . This must be checked using the validity mask again. Arrays Arrays are nested types that contain a single child type, repeated exactly array_size times per row. Think of them like a ... fixed-size array in C. Arrays work exactly the same as lists, except the length and offset of each entry is fixed. The fixed array size can be obtained ...
https://man.mtool.work/duckdb/2.0/clients/c/vector.html
Python Function API 8009
You can create a DuckDB user-defined function (UDF) from a Python function so it can be used in SQL queries. Similarly to regular functions , they need to have a name, a return type and parameter types. Creating Functions To register a Pyth ... parameter specifies the return type of the function. type (optional): DuckDB supports both native Python types and PyArrow Arrays. By default, type = 'native' is assumed, but you can specify type = 'arrow' to use PyArrow Arrays. In general, using an Ar ... rrently, two function types are supported, native (default) and arrow . Arrow If the function is expected to receive arrow arrays, set the type parameter to 'arrow' . This will let the system know to provide each argument as a pyarrow.ChunkedArray of a ...
https://man.mtool.work/duckdb/2.0/clients/python/function.html
Guides 8009
The guides section contains compact how-to guides that are focused on achieving a single goal. For API references and examples, see the rest of the documentation. Note that there are many tools using DuckDB, which are not covered in the off ... to create a table from a Pandas DataFrame How to export data to a Pandas DataFrame NumPy How to create a table from NumPy arrays How to export data to NumPy arrays Apache Arrow How to execute SQL on Apache Arrow How to create a DuckDB table from Apach ...
https://man.mtool.work/duckdb/2.0/guides/overview.html
PREV 1 2 3 NEXT
DuckDB 2.0 Documentation / man.mtool.work