You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/guides/hyper_file/create_update.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -42,8 +42,8 @@ The script consist of 3 high-level steps:
42
42
43
43
1. Start a Hyper process. The [`HyperProcess`](../../hyper-api/hyper_process)
44
44
2. Create a connection to the `.hyper` file. Since we create the [`Connection`](../../hyper-api/connection) class with the `CreateMode.CREATE_AND_REPLACE`, the `.hyper` file will be automatically created if it does not exist yet, and will be overwritten if a file with that name already exists.
45
-
3. Defining the table. In this case, we are using the Python utilities `TableDefinition` and `catalog.create_table`. We could have also used a [CREATE TABLE](../../sql/command/create_table) SQL command.
46
-
4. Insert the data. In the example, we use the `Inserter` utility to provide the data from Python. You can also use [INSERT](../../sql/command/insert) or [COPY](../../sql/command/copy_from) statements or any other means to load data into the table. E.g., you can thereby directly load your table from a CSV file.
45
+
3. Defining the table. In this case, we are using the Python utilities `TableDefinition` and `catalog.create_table`. We could have also used a [CREATE TABLE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/create-table.html) SQL command.
46
+
4. Insert the data. In the example, we use the `Inserter` utility to provide the data from Python. You can also use [INSERT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/insert.html) or [COPY](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/copy-from.html) statements or any other means to load data into the table. E.g., you can thereby directly load your table from a CSV file.
47
47
48
48
#### File Format Versions
49
49
@@ -64,7 +64,7 @@ The main difference when connecting is that you use `CreateMode.NONE` instead of
64
64
By using `CreateMode.NONE`, Hyper will connect to a pre-existing file instead of recreating a new, empty file.
65
65
Since the default for `CreateMode` is `NONE`, you can also just leave this parameter out completely.
66
66
67
-
You can then use SQL commands ([INSERT](../../sql/command/insert), [UPDATE](../../sql/command/update), [DELETE](../../sql/command/delete), [COPY](../../sql/command/copy_from), ...) or the `Inserter` utility class to change the data in the table.
67
+
You can then use SQL commands ([INSERT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/insert.html), [UPDATE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/update.html), [DELETE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/delete.html), [COPY](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/copy-from.html) or the `Inserter` utility class to change the data in the table.
68
68
You could also create new tables or drop existing tables.
69
69
70
70
The following example removes rows with a `value < 50` and appends two new row to an existing table within an extract file:
Note if you have WKT data in a comma-separated value (CSV) file, you can use the [COPY](/docs/sql/command/copy_from) command to insert the data from a CSVfile. The command automatically converts the WKT strings to the `tableau.tabgeography` data type. For more information, see the [Example code using copy fromCSV](#example-code-using-copy-from-csv) and the Help topic [Insert Data Directly from CSV Files](./insert_csv) and the CSV sample on GitHub, [hyper-api-samples](https://github.com/tableau/hyper-api-samples).
65
+
Note if you have WKT data in a comma-separated value (CSV) file, you can use the [COPY](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/copy-from.html) command to insert the data from a CSVfile. The command automatically converts the WKT strings to the `tableau.tabgeography` data type. For more information, see the [Example code using copy fromCSV](#example-code-using-copy-from-csv) and the Help topic [Insert Data Directly from CSV Files](./insert_csv) and the CSV sample on GitHub, [hyper-api-samples](https://github.com/tableau/hyper-api-samples).
Copy file name to clipboardExpand all lines: website/docs/guides/hyper_file/insert_csv.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Insert Data Directly from CSV Files
2
2
3
-
Comma-separated values (CSV) are a popular file format to import and export tabular data from programs. Hyper is able to directly load data into a Hyper table. Using the PostgreSQL-like [COPY FROM](/docs/sql/command/copy_from) command, you can copy the data much faster than you could by iteratively adding the data one row at a time.
3
+
Comma-separated values (CSV) are a popular file format to import and export tabular data from programs. Hyper is able to directly load data into a Hyper table. Using the [COPY FROM](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/copy-from.html) command, you can copy the data much faster than you could by iteratively adding the data one row at a time.
4
4
5
5
```python
6
6
from pathlib import Path
@@ -55,8 +55,8 @@ with HyperProcess(telemetry=Telemetry.SEND_USAGE_DATA_TO_TABLEAU) as hyper:
55
55
56
56
3. Issue the `COPY FROM` command.
57
57
58
-
The [COPY FROM](../../sql/command/copy_from) command instructs Hyper to
59
-
directly insert data from an external file into a table.
58
+
The [COPY FROM](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/copy-from.html)
59
+
command instructs Hyper to directly insert data from an external file into a table.
60
60
The `COPY` command's `WITH` clause specifies additional details about the file format: In this case, the CSV file uses a comma as the delimiter and has a header row.
61
61
62
62
To construct the SQL command and correctly escape the file path, we use `escape_string_literal`.
Copy file name to clipboardExpand all lines: website/docs/guides/hyper_file/read.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Read Data from Hyper Files
2
2
3
3
To read data from a `.hyper` file, open a `Connection` to the file and
4
-
then use the [SELECT](../../sql/command/select.md) command to retrieve data from the file.
4
+
then use the [SELECT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/select.html) command to retrieve data from the file.
5
5
6
6
```python
7
7
from tableauhyperapi import HyperProcess, Connection, Telemetry, CreateMode, Inserter
@@ -26,5 +26,5 @@ with HyperProcess(Telemetry.SEND_USAGE_DATA_TO_TABLEAU) as hyper:
26
26
```
27
27
28
28
In general, you can send arbitrarily complex queries against the data in a Hyper file.
29
-
More information on the available SQL commands can be found in the [SQL reference](../../sql/).
29
+
More information on the available SQL commands can be found in the [SQL reference](../../sql).
30
30
For more information on how to issue SQL queries from Python (or your preferred language) and how to make programatically craft SQL queries, see the [Executing SQL Commands](../sql_commands) guide.
To kickstart your creativity on potential use cases, let's use Hyper to run an analytical query on a Parquet file - and read the result back to a pandas frame using `pantab`.
43
43
44
44
You can send SQL queries to Hyper and get the result as a pandas dataframe using `pantab.frame_from_hyper_query`.
45
-
Combined with Hyper's capabilities to [query external file formats](../sql/external/), you can use this, e.g., to directly run queries on your Parquet files, Iceberg tables or Parquet files.
45
+
Combined with Hyper's capabilities to [query external file formats](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/external-files.html), you can use this, e.g., to directly run queries on your Parquet files, Iceberg tables or Parquet files.
46
46
The following example demonstrates this on the Parquet file `orders_10rows.parquet` which you can [download here](https://github.com/tableau/hyper-api-samples/raw/main/Community-Supported/parquet-to-hyper/orders_10rows.parquet).
[DELETE](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/delete.html) etc., all of which don't produce any
53
55
result tuples but instead are executed because we are interested in their
54
56
side effects. `execute_command` returns the number of rows affected by the
55
57
command.
@@ -76,7 +78,7 @@ that single result value.
76
78
77
79
Using Hyper SQL you can, e.g., insert, update, and delete data from tables, import data from
78
80
Parquet files or pose arbitrarily complex analytical queries.
79
-
For a reference documentation of the supported commands, see [Hyper SQL commands](/docs/sql/command/).
81
+
For a reference documentation of the supported commands, see our [SQL reference](/docs/sql).
80
82
81
83
Because the SQL statements are passed to the Hyper API as strings, you need to ensure that
82
84
identifiers and string values are properly encoded.
@@ -123,7 +125,7 @@ INSERT INTO "Guest Names" VALUES('Francisco Eduardo')
123
125
124
126
The table name must be in double quotes and the string constant in single quotes.
125
127
126
-
Escaping for identifiers and strings is documented in [General Syntax](../sql/syntax.md).
128
+
Escaping for identifiers and strings is documented in [General Syntax](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/syntax.html).
127
129
Instead of reimplementing those escaping rules by yourself, you can use the `escape_name`
128
130
and `escape_string_literal` functions to correctly format identifiers and strings in
0 commit comments