Skip to content

Commit abbbbec

Browse files
committed
Freshness and formatting
1 parent 7c95a67 commit abbbbec

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

articles/synapse-analytics/sql/create-use-external-tables.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ title: Create and use external tables in Synapse SQL pool
33
description: In this section, you'll learn how to create and use external tables in Synapse SQL pool.
44
author: vvasic-msft
55
ms.service: azure-synapse-analytics
6-
ms.topic: overview
6+
ms.topic: how-to
77
ms.subservice: sql
8-
ms.date: 02/02/2022
8+
ms.date: 12/11/2024
99
ms.author: vvasic
1010
ms.reviewer: whhender, wiassaf
1111
---
@@ -78,14 +78,12 @@ The queries in this article will be executed on your sample database and use the
7878

7979
## External table on a file
8080

81-
You can create external tables that access data on an Azure storage account that allows access to users with some Microsoft Entra identity or SAS key. You can create external tables the same way you create regular SQL Server external tables.
81+
You can create external tables that access data on an Azure storage account that allows access to users with some Microsoft Entra identity or SAS key. You can create external tables the same way you create regular SQL Server external tables.
8282

83-
The following query creates an external table that reads *population.csv* file from SynapseSQL demo Azure storage account that is referenced using `sqlondemanddemo` data source and protected with database scoped credential called `sqlondemand`.
84-
85-
Data source and database scoped credential are created in [setup script](https://github.com/Azure-Samples/Synapse/blob/master/SQL/Samples/LdwSample/SampleDB.sql).
83+
The following query creates an external table that reads *population.csv* file from SynapseSQL demo Azure storage account that is referenced using `sqlondemanddemo` data source and protected with database scoped credential called `sqlondemand`.
8684

8785
> [!NOTE]
88-
> Change the first line in the query, i.e., [mydbname], so you're using the database you created.
86+
> Change the first line in the query, i.e., [mydbname], so you're using the database you created.
8987
9088
```sql
9189
USE [mydbname];
@@ -128,15 +126,15 @@ CREATE EXTERNAL TABLE Taxi (
128126
);
129127
```
130128
131-
You can specify the pattern that the files must satisfy in order to be referenced by the external table. The pattern is required only for Parquet and CSV tables. If you are using Delta Lake format, you need to specify just a root folder, and the external table will automatically find the pattern.
129+
You can specify the pattern that the files must satisfy in order to be referenced by the external table. The pattern is required only for Parquet and CSV tables. If you're using Delta Lake format, you need to specify just a root folder, and the external table will automatically find the pattern.
132130
133131
> [!NOTE]
134132
> The table is created on partitioned folder structure, but you cannot leverage some partition elimination. If you want to get better performance by skipping the files that do not satisfy some criterion (like specific year or month in this case), use [views on external data](create-use-views.md#partitioned-views).
135133
136134
## External table on appendable files
137135
138-
The files that are referenced by an external table should not be changed while the query is running. In the long-running query, SQL pool may retry reads, read parts of the files, or even read the file multiple times. Changes of the file content would cause wrong results. Therefore, the SQL pool fails the query if detects that the modification time of any file is changed during the query execution.
139-
In some scenarios you might want to create a table on the files that are constantly appended. To avoid the query failures due to constantly appended files, you can specify that the external table should ignore potentially inconsistent reads using the `TABLE_OPTIONS` setting.
136+
The files that are referenced by an external table shouldn't be changed while the query is running. In the long-running query, SQL pool could retry reads, read parts of the files, or even read the file multiple times. Changes of the file content would cause wrong results. Therefore, the SQL pool fails the query if detects that the modification time of any file is changed during the query execution.
137+
In some scenarios, you might want to create a table on the files that are constantly appended. To avoid the query failures due to constantly appended files, you can specify that the external table should ignore potentially inconsistent reads using the `TABLE_OPTIONS` setting.
140138
141139
142140
```sql
@@ -155,7 +153,7 @@ WITH (
155153
);
156154
```
157155
158-
The `ALLOW_INCONSISTENT_READS` read option will disable file modification time check during the query lifecycle and read whatever is available in the files that are referenced by the external table. In appendable files, the existing content is not updated, and only new rows are added. Therefore, the probability of wrong results is minimized compared to the updateable files. This option might enable you to read the frequently appended files without handling the errors.
156+
The `ALLOW_INCONSISTENT_READS` read option will disable file modification time check during the query lifecycle and read whatever is available in the files that are referenced by the external table. In appendable files, the existing content isn't updated, and only new rows are added. Therefore, the probability of wrong results is minimized compared to the updateable files. This option might enable you to read the frequently appended files without handling the errors.
159157
160158
This option is available only in the external tables created on CSV file format.
161159
@@ -183,11 +181,11 @@ CREATE EXTERNAL TABLE Covid (
183181
);
184182
```
185183
186-
External tables cannot be created on a partitioned folder. Review the other known issues on [Synapse serverless SQL pool self-help page](resources-self-help-sql-on-demand.md#delta-lake).
184+
External tables can't be created on a partitioned folder. Review the other known issues on [Synapse serverless SQL pool self-help page](resources-self-help-sql-on-demand.md#delta-lake).
187185
188186
### Delta tables on partitioned folders
189187
190-
External tables in serverless SQL pools do not support partitioning on Delta Lake format. Use [Delta partitioned views](create-use-views.md#delta-lake-partitioned-views) instead of tables if you have partitioned Delta Lake data sets.
188+
External tables in serverless SQL pools don't support partitioning on Delta Lake format. Use [Delta partitioned views](create-use-views.md#delta-lake-partitioned-views) instead of tables if you have partitioned Delta Lake data sets.
191189
192190
> [!IMPORTANT]
193191
> Do not create external tables on partitioned Delta Lake folders even if you see that they might work in some cases. Using unsupported features like external tables on partitioned delta folders might cause issues or instability of the serverless pool. Azure support will not be able to resolve any issue if it is using tables on partitioned folders. You would be asked to transition to [Delta partitioned views](create-use-views.md#delta-lake-partitioned-views) and rewrite your code to use only the supported feature before proceeding with issue resolution.
@@ -216,6 +214,7 @@ ORDER BY
216214
217215
Performance of this query might vary depending on region. Your workspace might not be placed in the same region as the Azure storage accounts used in these samples. For production workloads, place your Synapse workspace and Azure storage in the same region.
218216
219-
## Next steps
217+
## Next step
220218
221-
For information on how to store results of a query to storage, refer to [Store query results to the storage](../sql/create-external-table-as-select.md) article.
219+
> [!div class="nextstepaction"]
220+
> [Store query results to the storage](../sql/create-external-table-as-select.md)

0 commit comments

Comments
 (0)