---
title: "Snowflake Protocol Compatibility"
---

# Snowflake Protocol Compatibility

:::caution[Planned: not in the current release]
Snowflake SQL API compatibility for HeliosDB Full is planned. Today, the HTTP gateway answers `/snowflake/` paths with `501 Not Implemented`. Reach
the same data over the PostgreSQL listener or `POST /api/v1/query` today. This page
describes the planned interface.
:::

Detailed feature compatibility matrix for Snowflake protocol support in HeliosDB.

## Feature Coverage: 90%+

### Core Features

| Feature | Result | Notes |
|---------|--------|-------|
| SQL API | Supported | Full statement execution |
| Authentication | Supported | Key pair, password |
| Sessions | Supported | Session management |
| Contexts | Supported | Warehouse/DB/Schema |
| Query History | Supported | Full history access |

### Time Travel

| Feature | Result | Notes |
|---------|--------|-------|
| AT (TIMESTAMP) | Supported | Query at specific time |
| AT (OFFSET) | Supported | Query at relative offset |
| AT (STATEMENT) | Supported | Query at statement ID |
| BEFORE (STATEMENT) | Supported | Query before statement |
| CHANGES() | Supported | Track changes |
| UNDROP | Supported | Restore dropped objects |

```sql
-- Time travel examples
SELECT * FROM orders AT(TIMESTAMP => '2024-01-01 00:00:00');
SELECT * FROM orders AT(OFFSET => -3600);  -- 1 hour ago
SELECT * FROM orders BEFORE(STATEMENT => 'statement-id');
```

### VARIANT Data Type

| Feature | Result | Notes |
|---------|--------|-------|
| VARIANT storage | Supported | Semi-structured data |
| Path notation | Supported | `data:field:subfield` |
| Array indexing | Supported | `data:items[0]` |
| Type casting | Supported | `::STRING`, `::NUMBER` |
| PARSE_JSON | Supported | JSON to VARIANT |
| TO_VARIANT | Supported | Convert to VARIANT |
| GET/GET_PATH | Supported | Field access |

```sql
-- VARIANT examples
SELECT data:name::STRING as name FROM json_table;
SELECT data:items[0].price::NUMBER as price FROM orders;
```

### FLATTEN Function

| Feature | Result | Notes |
|---------|--------|-------|
| Basic FLATTEN | Supported | Unnest arrays |
| LATERAL FLATTEN | Supported | Correlated unnesting |
| Recursive | Supported | Nested structures |
| OUTER | Supported | Preserve NULLs |
| PATH | Supported | Specify path |
| MODE | Supported | ARRAY, OBJECT, BOTH |

```sql
-- FLATTEN examples
SELECT f.value:id, f.value:name
FROM orders, LATERAL FLATTEN(input => items) f;

SELECT f.value
FROM data, LATERAL FLATTEN(input => nested:array, recursive => true) f;
```

### Virtual Warehouses

| Feature | Result | Notes |
|---------|--------|-------|
| CREATE WAREHOUSE | Supported | All sizes |
| ALTER WAREHOUSE | Supported | Resize, suspend/resume |
| DROP WAREHOUSE | Supported | - |
| AUTO_SUSPEND | Supported | Configurable timeout |
| AUTO_RESUME | Supported | On query submission |
| MULTI_CLUSTER | Supported | Scaling policies |
| USE WAREHOUSE | Supported | Context switching |

```sql
-- Warehouse management
CREATE WAREHOUSE analytics_wh WITH
  WAREHOUSE_SIZE = 'LARGE'
  AUTO_SUSPEND = 300
  AUTO_RESUME = TRUE
  MIN_CLUSTER_COUNT = 1
  MAX_CLUSTER_COUNT = 4;

ALTER WAREHOUSE analytics_wh SET WAREHOUSE_SIZE = 'XLARGE';
ALTER WAREHOUSE analytics_wh SUSPEND;
ALTER WAREHOUSE analytics_wh RESUME;
```

### COPY INTO

| Feature | Result | Notes |
|---------|--------|-------|
| From stage | Supported | Internal/external |
| File formats | Supported | CSV, JSON, Parquet, Avro, ORC |
| Cloud storage | Supported | S3, Azure, GCS |
| Pattern matching | Supported | File patterns |
| ON_ERROR | Supported | Error handling |
| Compression | Supported | GZIP, Snappy, ZSTD |

```sql
-- COPY INTO examples
COPY INTO my_table
FROM @my_stage/data/
FILE_FORMAT = (TYPE = 'JSON')
ON_ERROR = 'CONTINUE';

COPY INTO my_table
FROM 's3://bucket/path/'
CREDENTIALS = (AWS_KEY_ID = '...' AWS_SECRET_KEY = '...')
FILE_FORMAT = (TYPE = 'PARQUET');
```

### SQL Functions

#### Semi-Structured Functions

| Function | Result | Description |
|----------|--------|-------------|
| PARSE_JSON | Supported | Parse JSON string |
| TO_JSON | Supported | Convert to JSON |
| TO_VARIANT | Supported | Convert to VARIANT |
| TRY_PARSE_JSON | Supported | Safe JSON parse |
| OBJECT_CONSTRUCT | Supported | Build objects |
| ARRAY_CONSTRUCT | Supported | Build arrays |
| ARRAY_AGG | Supported | Aggregate to array |
| OBJECT_AGG | Supported | Aggregate to object |
| GET | Supported | Get by key |
| GET_PATH | Supported | Get by path |

#### String Functions

| Function | Result | Description |
|----------|--------|-------------|
| CONTAINS | Supported | String contains |
| STARTSWITH | Supported | String starts with |
| ENDSWITH | Supported | String ends with |
| SPLIT | Supported | Split string |
| SPLIT_PART | Supported | Get split part |
| LISTAGG | Supported | Concatenate with delimiter |

#### Utility Functions

| Function | Result | Description |
|----------|--------|-------------|
| GENERATE_UUID | Supported | Generate UUID |
| RANDOM | Supported | Random number |
| TRY_CAST | Supported | Safe type cast |
| COALESCE | Supported | First non-null |
| NVL/NVL2 | Supported | Null handling |
| IFF | Supported | Conditional |

### Data Types

| Type | Result | Notes |
|------|--------|-------|
| NUMBER | Supported | Numeric |
| FLOAT | Supported | Floating point |
| VARCHAR | Supported | Variable string |
| BINARY | Supported | Binary data |
| BOOLEAN | Supported | Boolean |
| DATE | Supported | Date only |
| TIME | Supported | Time only |
| TIMESTAMP_NTZ | Supported | No timezone |
| TIMESTAMP_LTZ | Supported | Local timezone |
| TIMESTAMP_TZ | Supported | With timezone |
| VARIANT | Supported | Semi-structured |
| OBJECT | Supported | JSON object |
| ARRAY | Supported | JSON array |
| GEOGRAPHY | Supported | Geospatial |

### Session Parameters

| Parameter | Result | Description |
|-----------|--------|-------------|
| QUERY_TAG | Supported | Tag queries |
| TIMEZONE | Supported | Session timezone |
| DATE_OUTPUT_FORMAT | Supported | Date format |
| TIMESTAMP_OUTPUT_FORMAT | Supported | Timestamp format |
| BINARY_OUTPUT_FORMAT | Supported | Binary format |

## Known Limitations

1. **Streams**: Not yet supported
2. **Tasks**: Not yet supported
3. **Pipes**: Not yet supported
4. **Dynamic Tables**: Not yet supported
5. **Snowpark**: Not supported (Python UDFs)

## Migration Notes

When migrating from Snowflake to HeliosDB:

1. **Connection**: Update connection string
2. **Warehouses**: Virtual warehouses work similarly
3. **SQL**: Most Snowflake SQL is compatible
4. **VARIANT**: Full support for semi-structured data
5. **Time Travel**: Same syntax supported

---
