Skip to content

Commit dad825f

Browse files
authored
Adding explanation on missing columns
Adding explanation on missing columns in case of automatic schema inference
1 parent 9815deb commit dad825f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

articles/synapse-analytics/sql/resources-self-help-sql-on-demand.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,10 @@ There are several mitigation steps that you can do to avoid this:
722722
- If you are using delta file format, use the optimize write feature in Spark. This can improve the performance of queries by reducing the amount of data that needs to be read and processed. How to use optimize write is described in [Using optimize write on Apache Spark](../spark/optimize-write-for-apache-spark.md).
723723
- To avoid some of the top-level wildcards by effectively hardcoding the implicit filters over partitioning columns use [dynamic SQL](../sql/develop-dynamic-sql.md).
724724

725+
### Missing column when using automatic schema inference
726+
727+
You can easily query files without knowing or specifying schema, by omitting WITH clause. In that case column names and data types will be inferred from the files. Have in mind that if you are reading number of files at once, the schema will be inferred from the first file service gets from the storage. This can mean that some of the columns expected are omitted, all because the file used by the service to define the schema did not contain these columns. To explicitly specify the schema, please use OPENROWSET WITH clause. If you specify schema (by using external table or OPENROWSET WITH clause) default lax path mode will be used. That means that the columns that don’t exist in some files will be returned as NULLs (for rows from those files). To understand how path mode is used, please check the following [documentation](../sql/develop-openrowset.md) and [sample](../sql/develop-openrowset.md#specify-columns-using-json-paths).
728+
725729
## Configuration
726730

727731
Serverless SQL pools enable you to use T-SQL to configure database objects. There are some constraints:

0 commit comments

Comments
 (0)