mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-16 00:32:26 +00:00
docs: fix SQL examples a deployment rejects
- CREATE INDEX: the example left out USING, which the server requires, and the page said SQL cannot choose the algorithm or name the index. USING names the algorithm, the page lists them, and a name before ON is taken where the deployment's configuration allows it. - The search join passed fts() a bare string; fts() takes JSON. - Sampling a subquery's result is refused, so the sampling and subquery pages sample the table inside the subquery, and the refusals list it. - Two unaliased casts in one projection produce the same column name; the example aliases them. - A json_get nested in another json_get is refused. The page shows one level of nesting and json_extract with a JSONPath for deeper values, and corrects what json_extract and json_extract_with_type return.
This commit is contained in:
@@ -66,10 +66,13 @@ or a name with mixed case: `SELECT "order" FROM "MyTable"`.
|
||||
## Casting {#casting}
|
||||
|
||||
```sql
|
||||
SELECT CAST(identifier AS VARCHAR), identifier::VARCHAR FROM documents
|
||||
SELECT CAST(identifier AS VARCHAR) AS with_cast, identifier::VARCHAR AS with_colons
|
||||
FROM documents
|
||||
```
|
||||
|
||||
Both forms work. `TRY_CAST` returns null instead of erroring on a value that
|
||||
Both forms work. Give each its own alias when one projection uses both: they
|
||||
produce the same expression name, and a projection refuses two columns with
|
||||
one name. `TRY_CAST` returns null instead of erroring on a value that
|
||||
will not convert, which is the one to use over a column you do not control.
|
||||
|
||||
## Precedence {#precedence}
|
||||
|
||||
Reference in New Issue
Block a user