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
is the one- to three-part name of the table to create in the database. For an external table, only the table metadata is stored in the relational database.
59
+
is the one- to three-part name of the table to create in the database. For an external table, only the table metadata is stored in the relational database.
60
+
61
+
**[ ( column_name [ ,...n ] ) ]**
62
+
is the name of a table column.
59
63
60
64
**LOCATION = '*hdfs_folder*'**
61
65
specifies where to write the results of the SELECT statement on the external data source. The location is a folder name and can optionally include a path that's relative to the root folder of the Hadoop cluster or Blob storage. PolyBase will create the path and folder if it doesn't already exist.
@@ -108,6 +112,13 @@ The external files are written to *hdfs_folder* and named *QueryID_date_time_ID.
108
112
**SELECT \<select_criteria>**
109
113
populates the new table with the results from a SELECT statement. *select_criteria* is the body of the SELECT statement that determines which data to copy to the new table. For information about SELECT statements, see [SELECT (Transact-SQL)](../../t-sql/queries/select-transact-sql.md).
110
114
115
+
**Column options**
116
+
117
+
column_name [ ,...n ]
118
+
Column names do not allow the column options mentioned in CREATE TABLE. Instead, you can provide an optional list of one or more column names for the new table. The columns in the new table will use the names you specify. When you specify column names, the number of columns in the column list must match the number of columns in the select results. If you don't specify any column names, the new target table will use the column names in the select statement results.
119
+
120
+
You cannot specify any other column options such as data types, collation, or nullability. Each of these attributes is derived from the results of the SELECT statement. However, you can use the SELECT statement to change the attributes. For an example, see [Use CETAS to change column attributes](#c-use-cetas-to-change-column-attributes).
121
+
111
122
## Permissions
112
123
113
124
To run this command, the *database user* needs all of these permissions or memberships:
@@ -234,6 +245,30 @@ ON ( T1.CustomerKey = T2.CustomerKey )
234
245
OPTION ( HASH JOIN );
235
246
```
236
247
248
+
### C. Use CETAS to change column attributes
249
+
This example uses CETAS to change data types, nullability, and collation for several columns in the `FactInternetSales` table.
0 commit comments