Skip to content

Commit 1593e38

Browse files
committed
Merge remote-tracking branch 'refs/remotes/Microsoft/master'
2 parents 7c276fc + 7e3ce6c commit 1593e38

File tree

3 files changed

+527
-5
lines changed

3 files changed

+527
-5
lines changed

samples/features/sql-bulk-load/load-from-azure-blob-storage/LoadFromAzureBlobStorage.sql

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/********************************************************************************
1+
2+
--/********************************************************************************
23
* Note: You can export file and create format file using bcp out command:
34
*
45
*>bcp "SELECT Name, Color, Price, Size, Quantity, Data, Tags FROM Product" queryout product.dat -d ProductCatalog -T
@@ -46,16 +47,17 @@ WITH ( TYPE = BLOB_STORAGE,
4647

4748
DROP TABLE IF EXISTS Product;
4849
GO
49-
50+
--Create a permanent table. A temp table currently is not supported for BULK INSERT, although it will will work
51+
--with OPENROWSET
5052
CREATE TABLE dbo.Product(
5153
Name nvarchar(50) NOT NULL,
5254
Color nvarchar(15) NULL,
5355
Price money NOT NULL,
5456
Size nvarchar(5) NULL,
5557
Quantity int NULL,
5658
Data nvarchar(4000) NULL,
57-
Tags nvarchar(4000) NULL,
58-
INDEX cci CLUSTERED COLUMNSTORE
59+
Tags nvarchar(4000) NULL
60+
--,INDEX cci CLUSTERED COLUMNSTORE
5961
)
6062
GO
6163

@@ -69,6 +71,7 @@ FROM 'product.csv'
6971
WITH ( DATA_SOURCE = 'MyAzureBlobStorage',
7072
FORMAT='CSV', CODEPAGE = 65001, --UTF-8 encoding
7173
FIRSTROW=2,
74+
ROWTERMINATOR = '0x0a',
7275
TABLOCK);
7376

7477
-- 2.2. INSERT file exported using bcp.exe into Product table
@@ -93,4 +96,4 @@ FROM OPENROWSET(BULK 'product.bcp',
9396
DATA_SOURCE = 'MyAzureBlobStorage',
9497
FORMATFILE='data/product.fmt',
9598
FORMATFILE_DATA_SOURCE = 'MyAzureBlobStorage') as data
96-
GROUP BY Color;
99+
GROUP BY Color;
Lines changed: 286 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,286 @@
1+
{
2+
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"parameters": {
5+
"location": {
6+
"type": "string",
7+
"defaultValue": ""
8+
},
9+
"resourcegroup": {
10+
"type": "string",
11+
"defaultValue": ""
12+
},
13+
"subscriptionId": {
14+
"type": "string",
15+
"defaultValue": ""
16+
},
17+
"workspace": {
18+
"type": "string",
19+
"defaultValue": ""
20+
},
21+
"workspaceapiversion": {
22+
"type": "string",
23+
"defaultValue": ""
24+
}
25+
},
26+
"resources": [{
27+
"apiVersion": "[parameters('workspaceapiversion')]",
28+
"name": "[parameters('workspace')]",
29+
"type": "Microsoft.OperationalInsights/workspaces",
30+
"location": "[parameters('location')]",
31+
"id": "[Concat('/subscriptions/', parameters('subscriptionId'), '/resourceGroups/', parameters('resourcegroup'), '/providers/Microsoft.OperationalInsights/workspaces/', parameters('workspace'))]",
32+
"resources": [{
33+
"apiVersion": "2015-11-01-preview",
34+
"name": "Data Sync",
35+
"type": "views",
36+
"location": "[parameters('location')]",
37+
"id": "[Concat('/subscriptions/', parameters('subscriptionId'), '/resourceGroups/', parameters('resourcegroup'), '/providers/Microsoft.OperationalInsights/workspaces/', parameters('workspace'),'/views/Data Sync')]",
38+
"dependson": [
39+
"[Concat('/subscriptions/', parameters('subscriptionId'), '/resourceGroups/', parameters('resourcegroup'), '/providers/Microsoft.OperationalInsights/workspaces/', parameters('workspace'))]"
40+
],
41+
"properties": {
42+
"Id": "Data Sync",
43+
"Name": "Data Sync",
44+
"Author": "[email protected]",
45+
"Source": "Local",
46+
"Version": 1,
47+
"Dashboard": [{
48+
"Id": "SingleQueryDonutBuilderBladeV1",
49+
"Type": "Blade",
50+
"Version": 0,
51+
"Configuration": {
52+
"General": {
53+
"title": "All Sync Groups",
54+
"newGroup": false,
55+
"icon": "",
56+
"useIcon": false
57+
},
58+
"Header": {
59+
"Title": "Error and Warnings",
60+
"Subtitle": ""
61+
},
62+
"Donut": {
63+
"Query": " LogLevel_s !=Success Type=DataSyncLog_CL TimeStamp_t>NOW-1DAY |measure count() by SyncGroupName_s",
64+
"CenterLegend": {
65+
"Text": "Total",
66+
"Operation": "Sum",
67+
"ArcsToSelect": []
68+
},
69+
"Options": {
70+
"colors": [
71+
"#00188f",
72+
"#0072c6",
73+
"#00bcf2"
74+
],
75+
"valueColorMapping": []
76+
}
77+
},
78+
"List": {
79+
"Query": " LogLevel_s !=Success Type=DataSyncLog_CL TimeStamp_t>NOW-1DAY | measure count() by SyncGroupName_s",
80+
"HideGraph": false,
81+
"enableSparklines": false,
82+
"operation": "Summary",
83+
"ColumnsTitle": {
84+
"Name": "Sync Group",
85+
"Value": "Error and Warning Count"
86+
},
87+
"Color": "#0072c6",
88+
"thresholds": {
89+
"isEnabled": true,
90+
"values": [{
91+
"name": "Norefaultmal",
92+
"threshold": "Default",
93+
"color": "#009e49",
94+
"isDefault": true
95+
},
96+
{
97+
"name": "Good",
98+
"threshold": "0",
99+
"color": "#fcd116",
100+
"isDefault": false
101+
},
102+
{
103+
"name": "Error",
104+
"threshold": "1",
105+
"color": "#ba141a",
106+
"isDefault": false
107+
}
108+
]
109+
},
110+
"NameDSVSeparator": "",
111+
"NavigationQuery": "{selected item}"
112+
}
113+
}
114+
},
115+
{
116+
"Id": "SingleQueryDonutBuilderBladeV1",
117+
"Type": "Blade",
118+
"Version": 0,
119+
"Configuration": {
120+
"General": {
121+
"title": "Sample Sync Group 1",
122+
"newGroup": false,
123+
"icon": "",
124+
"useIcon": false
125+
},
126+
"Header": {
127+
"Title": "Contoso Sync",
128+
"Subtitle": ""
129+
},
130+
"Donut": {
131+
"Query": "SyncGroupName_s=ContosoSync TimeStamp_t>NOW-1DAY| measure count() by LogLevel_s",
132+
"CenterLegend": {
133+
"Text": "",
134+
"Operation": "Sum",
135+
"ArcsToSelect": []
136+
},
137+
"Options": {
138+
"colors": [
139+
"#00188f",
140+
"#0072c6",
141+
"#00bcf2"
142+
],
143+
"valueColorMapping": []
144+
}
145+
},
146+
"List": {
147+
"Query": "LogLevel_s!=Success TimeStamp_t>NOW-1DAY SyncGroupName_s=ContosoSync | select Details_s",
148+
"HideGraph": false,
149+
"enableSparklines": false,
150+
"ColumnsTitle": {
151+
"Name": "Recent Errors and Warnings",
152+
"Value": ""
153+
},
154+
"Color": "#0072c6",
155+
"operation": "Summary",
156+
"thresholds": {
157+
"isEnabled": false,
158+
"values": [{
159+
"name": "Normal",
160+
"threshold": "Default",
161+
"color": "#009e49",
162+
"isDefault": true
163+
},
164+
{
165+
"name": "Warning",
166+
"threshold": "60",
167+
"color": "#fcd116",
168+
"isDefault": false
169+
},
170+
{
171+
"name": "Error",
172+
"threshold": "90",
173+
"color": "#ba141a",
174+
"isDefault": false
175+
}
176+
]
177+
},
178+
"NameDSVSeparator": "",
179+
"NavigationQuery": "{selected item}"
180+
}
181+
}
182+
},
183+
{
184+
"Id": "SingleQueryDonutBuilderBladeV1",
185+
"Type": "Blade",
186+
"Version": 0,
187+
"Configuration": {
188+
"General": {
189+
"title": "Sample Sync Group 2",
190+
"newGroup": false,
191+
"icon": "",
192+
"useIcon": false
193+
},
194+
"Header": {
195+
"Title": "Contsoso Sync 2",
196+
"Subtitle": ""
197+
},
198+
"Donut": {
199+
"Query": "SyncGroupName_s=ContosoSync2 TimeStamp_t>NOW-1DAY | measure count() by LogLevel_s",
200+
"CenterLegend": {
201+
"Text": "Total",
202+
"Operation": "Sum",
203+
"ArcsToSelect": []
204+
},
205+
"Options": {
206+
"colors": [
207+
"#00188f",
208+
"#0072c6",
209+
"#00bcf2"
210+
],
211+
"valueColorMapping": []
212+
}
213+
},
214+
"List": {
215+
"Query": "LogLevel_s=Error TimeStamp_t>NOW-1DAY SyncGroupName_s=ContosoSync2 |select Details_s",
216+
"HideGraph": false,
217+
"enableSparklines": false,
218+
"ColumnsTitle": {
219+
"Name": "Recent Errors and Warnings",
220+
"Value": ""
221+
},
222+
"Color": "#0072c6",
223+
"operation": "Summary",
224+
"thresholds": {
225+
"isEnabled": false,
226+
"values": [{
227+
"name": "Normal",
228+
"threshold": "Default",
229+
"color": "#009e49",
230+
"isDefault": true
231+
},
232+
{
233+
"name": "Warning",
234+
"threshold": "60",
235+
"color": "#fcd116",
236+
"isDefault": false
237+
},
238+
{
239+
"name": "Error",
240+
"threshold": "90",
241+
"color": "#ba141a",
242+
"isDefault": false
243+
}
244+
]
245+
},
246+
"NameDSVSeparator": "",
247+
"NavigationQuery": "{selected item}"
248+
}
249+
}
250+
}
251+
],
252+
"Filters": [],
253+
"OverviewTile": {
254+
"Id": "SingleQueryDonutBuilderTileV1",
255+
"Type": "OverviewTile",
256+
"Version": 0,
257+
"Configuration": {
258+
"Donut": {
259+
"Query": "Type=DataSyncLog_CL |measure count() by LogLevel_s",
260+
"CenterLegend": {
261+
"Text": "Total",
262+
"Operation": "Sum",
263+
"ArcsToSelect": []
264+
},
265+
"Options": {
266+
"colors": [
267+
"#00188f",
268+
"#0072c6",
269+
"#00bcf2"
270+
],
271+
"valueColorMapping": []
272+
}
273+
},
274+
"Advanced": {
275+
"DataFlowVerification": {
276+
"Enabled": false,
277+
"Query": "*",
278+
"Message": ""
279+
}
280+
}
281+
}
282+
}
283+
}
284+
}]
285+
}]
286+
}

0 commit comments

Comments
 (0)