Skip to content

Commit 6d1787e

Browse files
authored
Merge pull request #175026 from jovanpop-msft/patch-222
Added ROWSET_OPTIONS
2 parents 000b603 + 4f15cc3 commit 6d1787e

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

articles/synapse-analytics/sql/develop-openrowset.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ WITH ( {'column_name' 'column_type' [ 'column_ordinal' | 'json_path'] })
9393
[ , HEADER_ROW = { TRUE | FALSE } ]
9494
[ , DATAFILETYPE = { 'char' | 'widechar' } ]
9595
[ , CODEPAGE = { 'ACP' | 'OEM' | 'RAW' | 'code_page' } ]
96+
[ , ROWSET_OPTIONS = '{"READ_OPTIONS":["ALLOW_INCONSISTENT_READS"]}' ]
9697
```
9798

9899
## Arguments
@@ -238,16 +239,20 @@ CSV parser version 2.0 specifics:
238239
239240
HEADER_ROW = { TRUE | FALSE }
240241
241-
Specifies whether CSV file contains header row. Default is FALSE. Supported in PARSER_VERSION='2.0'. If TRUE, column names will be read from first row according to FIRSTROW argument. If TRUE and schema is specified using WITH, binding of column names will be done by column name, not ordinal positions.
242+
Specifies whether a CSV file contains header row. Default is `FALSE.` Supported in PARSER_VERSION='2.0'. If TRUE, the column names will be read from the first row according to FIRSTROW argument. If TRUE and schema is specified using WITH, binding of column names will be done by column name, not ordinal positions.
242243
243244
DATAFILETYPE = { 'char' | 'widechar' }
244245
245-
Specifies encoding: char is used for UTF8, widechar is used for UTF16 files.
246+
Specifies encoding: `char` is used for UTF8, `widechar` is used for UTF16 files.
246247
247248
CODEPAGE = { 'ACP' | 'OEM' | 'RAW' | 'code_page' }
248249
249250
Specifies the code page of the data in the data file. The default value is 65001 (UTF-8 encoding). See more details about this option [here](/sql/t-sql/functions/openrowset-transact-sql?view=sql-server-ver15&preserve-view=true#codepage).
250251
252+
ROWSET_OPTIONS = '{"READ_OPTIONS":["ALLOW_INCONSISTENT_READS"]}'
253+
254+
This option will disable the file modification check during the query execution, and read the files that are updated while the query is running. This is useful option when you need to read append-only files that are appended while the query is running. In the 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. See more information in [querying appendable CSV files](query-single-csv-file.md#querying-appendable-files) section.
255+
251256
## Fast delimited text parsing
252257
253258
There are two delimited text parser versions you can use. CSV parser version 1.0 is default and feature rich while parser version 2.0 is built for performance. Performance improvement in parser 2.0 comes from advanced parsing techniques and multi-threading. Difference in speed will be bigger as the file size grows.
@@ -256,9 +261,9 @@ There are two delimited text parser versions you can use. CSV parser version 1.0
256261
257262
You can easily query both CSV and Parquet files without knowing or specifying schema by omitting WITH clause. Column names and data types will be inferred from files.
258263
259-
Parquet files contain column metadata which will be read, type mappings can be found in [type mappings for Parquet](#type-mapping-for-parquet). Check [reading Parquet files without specifying schema](#read-parquet-files-without-specifying-schema) for samples.
264+
Parquet files contain column metadata, which will be read, type mappings can be found in [type mappings for Parquet](#type-mapping-for-parquet). Check [reading Parquet files without specifying schema](#read-parquet-files-without-specifying-schema) for samples.
260265
261-
For CSV files column names can be read from header row. You can specify whether header row exists using HEADER_ROW argument. If HEADER_ROW = FALSE, generic column names will be used: C1, C2, ... Cn where n is number of columns in file. Data types will be inferred from first 100 data rows. Check [reading CSV files without specifying schema](#read-csv-files-without-specifying-schema) for samples.
266+
For the CSV files, column names can be read from header row. You can specify whether header row exists using HEADER_ROW argument. If HEADER_ROW = FALSE, generic column names will be used: C1, C2, ... Cn where n is number of columns in file. Data types will be inferred from first 100 data rows. Check [reading CSV files without specifying schema](#read-csv-files-without-specifying-schema) for samples.
262267
263268
> [!IMPORTANT]
264269
> There are cases when appropriate data type cannot be inferred due to lack of information and larger data type will be used instead. This brings performance overhead and is particularly important for character columns which will be inferred as varchar(8000). For optimal performance, please [check inferred data types](./best-practices-serverless-sql-pool.md#check-inferred-data-types) and [use appropriate data types](./best-practices-serverless-sql-pool.md#use-appropriate-data-types).
@@ -422,4 +427,4 @@ AS [r]
422427
423428
## Next steps
424429
425-
For more samples, see the [query data storage quickstart](query-data-storage.md) to learn how to use `OPENROWSET` to read [CSV](query-single-csv-file.md), [PARQUET](query-parquet-files.md), [DELTA LAKE](query-delta-lake-format.md), and [JSON](query-json-files.md) file formats. Check [best practices](./best-practices-serverless-sql-pool.md) for achieving optimal performance. You can also learn how to save the results of your query to Azure Storage using [CETAS](develop-tables-cetas.md).
430+
For more samples, see the [query data storage quickstart](query-data-storage.md) to learn how to use `OPENROWSET` to read [CSV](query-single-csv-file.md), [PARQUET](query-parquet-files.md), [DELTA LAKE](query-delta-lake-format.md), and [JSON](query-json-files.md) file formats. Check [best practices](./best-practices-serverless-sql-pool.md) for achieving optimal performance. You can also learn how to save the results of your query to Azure Storage using [CETAS](develop-tables-cetas.md).

0 commit comments

Comments
 (0)