DataStore Factory Methods

```
DataStore.from_numbers(count, **kwargs)
```

**Examples:**

```
ds = DataStore.from_numbers(1000000)  # 1M rows with 'number' column
result = ds.filter(ds['number'] % 2 == 0).head(10)  # Even numbers
```

### `from_random`[​](#from-random "Direct link to from-random")

Create DataStore with random data.

```
DataStore.from_random(rows, columns, **kwargs)
```

**Examples:**

```
ds = DataStore.from_random(rows=1000, columns=5)
```

### `run_sql`[​](#run-sql "Direct link to run-sql")

Create DataStore from raw SQL query.

```
DataStore.run_sql(query)
```

**Examples:**

```
ds = DataStore.run_sql("""
    SELECT number, number * 2 as doubled
    FROM numbers(100)
    WHERE number % 10 = 0
""")
```

---

## Summary Table[​](#summary "Direct link to Summary Table")

|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Method Source Type Example|  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | `uri()` Universal `DataStore.uri("s3://bucket/data.parquet")`| `from_file()` Local/Remote files `DataStore.from_file("data.csv")`| `read_csv()` CSV files `pd.read_csv("data.csv")`| `read_parquet()` Parquet files `pd.read_parquet("data.parquet")`| `from_s3()` Amazon S3 `DataStore.from_s3("s3://bucket/path")`| `from_gcs()` Google Cloud Storage `DataStore.from_gcs("gs://bucket/path")`| `from_azure()` Azure Blob `DataStore.from_azure("az://container/path")`| `from_hdfs()` HDFS `DataStore.from_hdfs("hdfs://host/path")`| `from_url()` HTTP/HTTPS `DataStore.from_url("https://example.com/data.csv")`| `from_mysql()` MySQL `DataStore.from_mysql(host, db, table, user, pass)`| `from_postgresql()` PostgreSQL `DataStore.from_postgresql(host, db, table, user, pass)`| `from_clickhouse()` ClickHouse `DataStore.from_clickhouse(host, db, table)`| `from_mongodb()` MongoDB `DataStore.from_mongodb(uri, db, collection)`| `from_sqlite()` SQLite `DataStore.from_sqlite("data.db", table)`| `from_iceberg()` Apache Iceberg `DataStore.from_iceberg("/path/to/table")`| `from_delta()` Delta Lake `DataStore.from_delta("/path/to/table")`| `from_hudi()` Apache Hudi `DataStore.from_hudi("/path/to/table")`| `from_df()` pandas DataFrame `DataStore.from_df(pandas_df)`| `DataFrame()` Dictionary/DataFrame `pd.DataFrame({'a': [1, 2, 3]})`| `from_numbers()` Sequential numbers `DataStore.from_numbers(1000000)`| `from_random()` Random data `DataStore.from_random(rows=1000, columns=5)`| `run_sql()` Raw SQL `DataStore.run_sql("SELECT * FROM ...")` | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |

- [Universal URI Interface](#uri)
  - [URI Syntax Reference](#uri-syntax)- [File Sources](#file-sources)
    - [`from_file`](#from-file)- [Pandas-compatible read functions](#pandas-read)- [Cloud Storage](#cloud-storage)
      - [`from_s3`](#from-s3)- [`from_gcs`](#from-gcs)- [`from_azure`](#from-azure)- [`from_hdfs`](#from-hdfs)- [`from_url`](#from-url)- [Databases](#databases)
        - [`from_mysql`](#from-mysql)- [`from_postgresql`](#from-postgresql)- [`from_clickhouse`](#from-clickhouse)- [`from_mongodb`](#from-mongodb)- [`from_sqlite`](#from-sqlite)- [Data Lakes](#data-lakes)
          - [`from_iceberg`](#from-iceberg)- [`from_delta`](#from-delta)- [`from_hudi`](#from-hudi)- [In-Memory Sources](#in-memory)
            - [`from_df` / `from_dataframe`](#from-df)- [`DataFrame` Constructor](#dataframe-constructor)- [Special Sources](#special-sources)
              - [`from_numbers`](#from-numbers)- [`from_random`](#from-random)- [`run_sql`](#run-sql)- [Summary Table](#summary)

Was this page helpful?