How can I get DAG of Spark Sql Query execution plan? - apache-spark

I am doing some analysis on spark sql query execution plans. the execution plans that explain() api prints are not much readable. If we see spark web UI, a DAG graph is created which is divided into jobs, stages and tasks and much more readable. Is there any way to create that graph from execution plans or any apis in the code? if not, are there any apis that can read that grap from UI?

As close I can see, this project (https://github.com/AbsaOSS/spline-spark-agent) is able to interpret the execution plan and generate it in a readable way.
This spark job is reading a file, convert it to a CSV file, write to local.
A sample output in JSON look like
{
"id": "3861a1a7-ca31-4fab-b0f5-6dbcb53387ca",
"operations": {
"write": {
"outputSource": "file:/output.csv",
"append": false,
"id": 0,
"childIds": [
1
],
"params": {
"path": "output.csv"
},
"extra": {
"name": "InsertIntoHadoopFsRelationCommand",
"destinationType": "csv"
}
},
"reads": [
{
"inputSources": [
"file:/Users/liajiang/Downloads/spark-onboarding-demo-application/src/main/resources/wikidata.csv"
],
"id": 2,
"schema": [
"6742cfd4-d8b6-4827-89f2-4b2f7e060c57",
"62c022d9-c506-4e6e-984a-ee0c48f9df11",
"26f1d7b5-74a4-459c-87f3-46a3df781400",
"6e4063cf-4fd0-465d-a0ee-0e5c53bd52b0",
"2e019926-3adf-4ece-8ea7-0e01befd296b"
],
"params": {
"inferschema": "true",
"header": "true"
},
"extra": {
"name": "LogicalRelation",
"sourceType": "csv"
}
}
],
"other": [
{
"id": 1,
"childIds": [
2
],
"params": {
"name": "`source`"
},
"extra": {
"name": "SubqueryAlias"
}
}
]
},
"systemInfo": {
"name": "spark",
"version": "2.4.2"
},
"agentInfo": {
"name": "spline",
"version": "0.5.5"
},
"extraInfo": {
"appName": "spark-spline-demo-application",
"dataTypes": [
{
"_typeHint": "dt.Simple",
"id": "f0dede5e-8fe1-4c22-ab24-98f7f44a9a5a",
"name": "timestamp",
"nullable": true
},
{
"_typeHint": "dt.Simple",
"id": "dbe1d206-3d87-442c-837d-dfa47c88b9c1",
"name": "string",
"nullable": true
},
{
"_typeHint": "dt.Simple",
"id": "0d786d1e-030b-4997-b005-b4603aa247d7",
"name": "integer",
"nullable": true
}
],
"attributes": [
{
"id": "6742cfd4-d8b6-4827-89f2-4b2f7e060c57",
"name": "date",
"dataTypeId": "f0dede5e-8fe1-4c22-ab24-98f7f44a9a5a"
},
{
"id": "62c022d9-c506-4e6e-984a-ee0c48f9df11",
"name": "domain_code",
"dataTypeId": "dbe1d206-3d87-442c-837d-dfa47c88b9c1"
},
{
"id": "26f1d7b5-74a4-459c-87f3-46a3df781400",
"name": "page_title",
"dataTypeId": "dbe1d206-3d87-442c-837d-dfa47c88b9c1"
},
{
"id": "6e4063cf-4fd0-465d-a0ee-0e5c53bd52b0",
"name": "count_views",
"dataTypeId": "0d786d1e-030b-4997-b005-b4603aa247d7"
},
{
"id": "2e019926-3adf-4ece-8ea7-0e01befd296b",
"name": "total_response_size",
"dataTypeId": "0d786d1e-030b-4997-b005-b4603aa247d7"
}
]
}
}

Related

Shopware 6 API Create a Product with Variants

I created my products with the API and all is ok. But we have some products with variants. These looking good in the backend, but in the frontend shopware doesn't display the product. Where is my error in the payload?
Thank you for helping me!
Here is my code:
{
"write-product":
{
"entity": "product",
"action": "upsert",
"payload": [
{
"id": "17cf3bac8966cc4de52aa557f59e5fd3",
"active": true,
"deliveryTimeId": "1e04777cb17d4396b424129b2d8e3a79",
"description": "Produktbeschreibung",
"ean": null,
"featureSetId": null,
"manufacturerId": null,
"manufacturerNumber": null,
"minPurchase": 1,
"name": "Produktname",
"productNumber": "Nummer",
"releaseDate": "2022-09-28T14:12:18.03",
"stock": 999999,
"taxId": "2842fd17d5a7424795853e7fe7072448",
"price":[
{
"currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
"net": 13.77,
"gross": 16.39,
"linked": false
}
],
"categories":[
{
"id":"648875017ed54637a41c8c1f972c239f",
"name":"Kategoriename"
}
],
"configuratorSettings": [
{
"productId": "17cf3bac8966cc4de52aa557f59e5fd3",
"optionId": "2ab9df7d2dd94ad38eb53cf7dcf16e56"
},
{
"productId": "17cf3bac8966cc4de52aa557f59e5fd3",
"optionId": "0fcf784970ea448bac1f7db542df9b86"
},
{
"productId": "17cf3bac8966cc4de52aa557f59e5fd3",
"optionId": "0014aa7dc0b644b78cd4b39193f580b4"
}
],
"properties": [
{
"groupId":"ca74efd59b5545f2b4e4f532c217b2ce",
"name": "1,0 m"
},
{
"groupId":"fa7f63d697d44684a5bb74ba5a73d3c7",
"name": "2,0 mm"
},
{
"groupId":"a431bc98fe0149c3bf3ececf629e9740",
"name": "Material"
}
],
"visibilities": [
{
"id": "17cf3bac8966cc4de52aa557f59e5fd3",
"salesChannelId": "840a0403b56240b6a11502af1d46521e",
"visibility": 30
}
],
"coverId": "0f9ab99638bd0ea5e907234bf425819e",
"cover":
{
"mediaId": "0f9ab99638bd0ea5e907234bf425819e"
},
"media": [
{
"media":
{
"id": "0f9ab99638bd0ea5e907234bf425819e",
"position": 0,
"mediaFolderId": "d8f460870e454c0bbca540614ca30029",
"alt": "Bildname",
"description": "Bildbeschreibung",
"title": "Bildtitel"
}
}
],
"children": [
{
"id": "25c8876fb7577cad78df7539737d25ce",
"active": true,
"deliveryTimeId": "1e04777cb17d4396b424129b2d8e3a79",
"description": "Beschreibung Kindelement",
"ean": null,
"featureSetId": null,
"manufacturerId": null,
"manufacturerNumber": null,
"minPurchase": 1,
"name": "Name Kindelement",
"productNumber": "Nummer Kindelement",
"releaseDate": "2022-09-16T14:14:31.41",
"stock": 999999,
"taxId": "2842fd17d5a7424795853e7fe7072448",
"price":[
{
"currencyId": "b7d2554b0ce847cd82f3ac9bd1c0dfca",
"net": 82.63,
"gross": 98.33,
"linked": false
}
],
"categories":[
{
"id":"648875017ed54637a41c8c1f972c239f",
"name":"Kategoriename"
}
],
"configuratorSettings": [
{
"productId": "25c8876fb7577cad78df7539737d25ce",
"optionId": "b224173313cb4f8da03578ef83702751"
},
{
"productId": "25c8876fb7577cad78df7539737d25ce",
"optionId": "0fcf784970ea448bac1f7db542df9b86"
},
{
"productId": "25c8876fb7577cad78df7539737d25ce",
"optionId": "0014aa7dc0b644b78cd4b39193f580b4"
}
],
"properties": [
{
"groupId":"ca74efd59b5545f2b4e4f532c217b2ce",
"name": "6,0 m"
},
{
"groupId":"fa7f63d697d44684a5bb74ba5a73d3c7",
"name": "2,0 mm"
},
{
"groupId":"a431bc98fe0149c3bf3ececf629e9740",
"name": "Material"
}
],
"parentId": "17cf3bac8966cc4de52aa557f59e5fd3",
"options": [
{
"id":"b224173313cb4f8da03578ef83702751",
"group": {
"id":"ca74efd59b5545f2b4e4f532c217b2ce"}
},
{
"id":"0fcf784970ea448bac1f7db542df9b86",
"group": {
"id":"fa7f63d697d44684a5bb74ba5a73d3c7"}
},
{
"id":"0014aa7dc0b644b78cd4b39193f580b4",
"group": {
"id":"a431bc98fe0149c3bf3ececf629e9740"
}
}
],
"visibilities": [
{
"id": "25c8876fb7577cad78df7539737d25ce",
"salesChannelId": "840a0403b56240b6a11502af1d46521e",
"visibility": 30
}
],
"media": [
{
"media": {
"id": "fba6e74294488b554aa88f7dcf6f38f2",
"position": 0,
"mediaFolderId": "d8f460870e454c0bbca540614ca30029",
"alt": "Bildname Kindelement",
"description": "Beschreibung Kindelement",
"title": "Bildtitel Kindelement"
}
}
]
}
]
}
]
}
}
I'm searching in different boards and looking in the API Browser, Using swagger for the api and so on. No result. I need the main-product and the variants be visible in the frontend. At the moment all products with variants are invisible in the frontend.
Double check your Visibility & Categories. It could be them. Also, maybe you need to re-index after creation?
You have way too much stuff going on at the moment for us to help you out.
Try to split your calls into smaller chunks (for us). Also start with less data when creating a product. With every step check the frontend. Can you even create a simple product & display it on the frontend? Yes? Then try create the most basic child that inherits most of the visible parent.
For a child you do not need much data, e.g.
{
"write-product": {
"entity": "product",
"action": "upsert",
"payload": [
{
"parentId": "",
"options": [
{
"id": ""
}
],
"price": [
{
"currencyId": "{{gen_salesChannel_currency_id}}",
"gross": 0.0,
"net": 0.0,
"linked": false
}
]
"productNumber": "",
"stock": 999
}
]
}
}
Another tip is to use the network tab in the admin to see how it creates these relationships. Here is an image of how it looks like:

how to get a value of a json http response in azure logic app

I'm trying to get "id" value set to a variable by parsing the below output sample. The REST API call will return multiple values as shown below and I'm interested in only getting the "id" value for the particular name that users has provided/set as input in the workflow earlier either by a parameter value or by initializing a variable. How do I do this value extraction in azure logic app?
Any help much appreciated.
[
{
"id": 1,
"name": "xyz-List",
"data": {
"urls": [
"*.test1.com",
"*.test2.com"
],
"type": "exact"
},
"modify_by": "admin#xyz.com",
"modify_time": "2022-06-29T21:05:27.000Z",
"modify_type": "Created",
"pending": 0
},
{
"id": 2,
"name": "abc-List",
"data": {
"urls": [
"www.mytesting.com"
],
"type": "exact"
},
"modify_by": "admin#xyz.com",
"modify_time": "2022-06-29T21:05:27.000Z",
"modify_type": "Created",
"pending": 0
},
{
"id": 3,
"name": "azure-list",
"data": {
"type": "exact",
"urls": [
"www.xyz.com",
"www.azure-test.com"
],
"json_version": 2
},
"modify_by": "admin#xyz.com",
"modify_time": "2022-09-26T01:25:20.000Z",
"modify_type": "Edited",
"pending": 0
}
]
I have reproduced from my end and could able to make it work by parsing your REST API call value. To iterate through the Parsed JSON I have used a for-each loop and extracted the Id using the below expression and set its value to a variable.
#items('For_each')['id']
Below is the complete flow of my logic app
RESULTS:
To reproduce the same in your logic app you can use the below code view that worked for me.
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Compose": {
"inputs": [
{
"data": {
"type": "exact",
"urls": [
"*.test1.com",
"*.test2.com"
]
},
"id": 1,
"modify_by": "admin#xyz.com",
"modify_time": "2022-06-29T21:05:27.000Z",
"modify_type": "Created",
"name": "xyz-List",
"pending": 0
},
{
"data": {
"type": "exact",
"urls": [
"www.mytesting.com"
]
},
"id": 2,
"modify_by": "admin#xyz.com",
"modify_time": "2022-06-29T21:05:27.000Z",
"modify_type": "Created",
"name": "abc-List",
"pending": 0
},
{
"data": {
"json_version": 2,
"type": "exact",
"urls": [
"www.xyz.com",
"www.azure-test.com"
]
},
"id": 3,
"modify_by": "admin#xyz.com",
"modify_time": "2022-09-26T01:25:20.000Z",
"modify_type": "Edited",
"name": "azure-list",
"pending": 0
}
],
"runAfter": {
"Initialize_variable": [
"Succeeded"
]
},
"type": "Compose"
},
"For_each": {
"actions": {
"Set_variable": {
"inputs": {
"name": "Id",
"value": "#items('For_each')['id']"
},
"runAfter": {},
"type": "SetVariable"
}
},
"foreach": "#body('Parse_JSON')",
"runAfter": {
"Parse_JSON": [
"Succeeded"
]
},
"type": "Foreach"
},
"Initialize_variable": {
"inputs": {
"variables": [
{
"name": "Id",
"type": "integer"
}
]
},
"runAfter": {},
"type": "InitializeVariable"
},
"Parse_JSON": {
"inputs": {
"content": "#outputs('Compose')",
"schema": {
"items": {
"properties": {
"data": {
"properties": {
"type": {
"type": "string"
},
"urls": {
"items": {
"type": "string"
},
"type": "array"
}
},
"type": "object"
},
"id": {
"type": "integer"
},
"modify_by": {
"type": "string"
},
"modify_time": {
"type": "string"
},
"modify_type": {
"type": "string"
},
"name": {
"type": "string"
},
"pending": {
"type": "integer"
}
},
"required": [
"id",
"name",
"data",
"modify_by",
"modify_time",
"modify_type",
"pending"
],
"type": "object"
},
"type": "array"
}
},
"runAfter": {
"Compose": [
"Succeeded"
]
},
"type": "ParseJson"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"manual": {
"inputs": {
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {}
}
Load this into your tenant. You can use basic expressions with a condition to get your result ...
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_Each_Array_Item": {
"actions": {
"Condition": {
"actions": {
"Set_ID": {
"inputs": {
"name": "ID",
"value": "#item()['id']"
},
"runAfter": {},
"type": "SetVariable"
}
},
"expression": {
"and": [
{
"equals": [
"#item()['name']",
"abc-List"
]
}
]
},
"runAfter": {},
"type": "If"
}
},
"foreach": "#variables('Array Data')",
"runAfter": {
"Initialize_ID": [
"Succeeded"
]
},
"type": "Foreach"
},
"Initialize_Array_Data": {
"inputs": {
"variables": [
{
"name": "Array Data",
"type": "array",
"value": [
{
"data": {
"type": "exact",
"urls": [
"*.test1.com",
"*.test2.com"
]
},
"id": 1,
"modify_by": "admin#xyz.com",
"modify_time": "2022-06-29T21:05:27.000Z",
"modify_type": "Created",
"name": "xyz-List",
"pending": 0
},
{
"data": {
"type": "exact",
"urls": [
"www.mytesting.com"
]
},
"id": 2,
"modify_by": "admin#xyz.com",
"modify_time": "2022-06-29T21:05:27.000Z",
"modify_type": "Created",
"name": "abc-List",
"pending": 0
},
{
"data": {
"json_version": 2,
"type": "exact",
"urls": [
"www.xyz.com",
"www.azure-test.com"
]
},
"id": 3,
"modify_by": "admin#xyz.com",
"modify_time": "2022-09-26T01:25:20.000Z",
"modify_type": "Edited",
"name": "azure-list",
"pending": 0
}
]
}
]
},
"runAfter": {},
"type": "InitializeVariable"
},
"Initialize_ID": {
"inputs": {
"variables": [
{
"name": "ID",
"type": "integer"
}
]
},
"runAfter": {
"Initialize_Array_Data": [
"Succeeded"
]
},
"type": "InitializeVariable"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"ParameterTest1": {
"defaultValue": "\"\"",
"type": "String"
}
},
"triggers": {
"manual": {
"inputs": {
"method": "GET",
"schema": {}
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {}
}
My example looks for the name abc-List and if it finds it, it sets the ID variable to be the associated ID of that record it found the name against.

Azure Resource Manager Query with multiple dynamic tag filters

I'm trying to query the Azure Cost Management API and I want to be able to filter the results based off of 2 different types of resource tags but I am having trouble figuring out the format. I can get the single tag filter working, but I'm blanking on the format for multiple. Can anyone throw in their 2 cents?
Working single filter query:
{
"type": "Usage",
"timeframe": "{TimeFrame}",
"dataset": {
"granularity": "None",
"filter": {
"tags": {
"name": "Environment",
"operator": "In",
"values": [
{Environment}
]
}
},
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "{Aggregation}"
}
]
}
}
My attempt at adding more than one filter:
{
"type": "Usage",
"timeframe": "{TimeFrame}",
"dataset": {
"granularity": "None",
"filter": {
"tags": [
{
"name": "Environment",
"operator": "In",
"values": [
{Environment}
]
},
{
"name": "Location",
"operator": "In",
"values": [
{Location}
]
}
]
},
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "{Aggregation}"
}
]
}
}
I am very new to Azure so please don't roast me too hard lol.
Thank you to everyone who took a look at my question, much appreciated even if you don't have an answer for me.
There was an issue with the way my parameters were set causing a bad query. Here is the working code with multiple tag attributes for filtering:
{
"type": "Usage",
"timeframe": "{TimeFrame}",
"dataset": {
"granularity": "None",
"filter": {
"and": [
{
"tags": {
"name": "Location",
"operator": "In",
"values": [{LocationTag}]
}
},
{
"tags": {
"name": "Environment",
"operator": "In",
"Values": [{EnvironmentTag}]
}
},
{
"tags": {
"name": "Integrated-System",
"operator": "In",
"Values": [{IntegratedSystemTag}]
}
}
]
},
"aggregation": {
"totalCost": {
"name": "PreTaxCost",
"function": "Sum"
}
},
"grouping": [
{
"type": "Dimension",
"name": "{Aggregation}"
}
]
}
}

Facing an error while building a custom skil for amazon alexa

I am trying to a build a basic custom alexa skill. I have created an intent schema and am using AWS lambda function as the endpoint. ]
My Intent schema:
{
"interactionModel": {
"languageModel": {
"invocationName": "toit brewpub",
"modelConfiguration": {
"fallbackIntentSensitivity": {
"level": "LOW"
}
},
"intents": [
{
"name": "AMAZON.FallbackIntent",
"samples": []
},
{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples": []
},
{
"name": "GetClosingTime",
"slots": [],
"samples": [
"what time do you close",
"when is the last order",
"till what time are you open",
"What time does the pub close"
]
},
{
"name": "GetPriceOfBeer",
"slots": [
{
"name": "beer",
"type": "BEERS"
}
],
"samples": [
"how much is {beer}",
"what is the price of {beer}"
]
}
],
"types": [
{
"name": "BEERS",
"values": [
{
"name": {
"value": "Toit Red"
}
},
{
"name": {
"value": "Tiot Weiss"
}
},
{
"name": {
"value": "Basmati Blonde"
}
},
{
"name": {
"value": "Tintin Toit"
}
},
{
"name": {
"value": "IPA"
}
},
{
"name": {
"value": "Dark Knight"
}
}
]
}
]
}
}
}
I am using Node.js v 10.x for my lamda function which has been built using Alexa-Skills-NodeJS-Fact-kit, The region for my aws lambda is US_EAST- N.VIRGINIA.
Below is the request I receive when I talk to my Test Simulator:
{
"version": "1.0",
"session": {
"new": false,
"sessionId": "amzn1.echo-api.session.fd1c5315-ecf8-413f-ba25-e54bd6ae316a",
"application": {
"applicationId": "amzn1.ask.skill.72615503-5f38-4baf-b0dd-cd6edd3b6dfd"
},
"user": {
"userId": ""
}
},
"context": {
"System": {
"application": {
"applicationId": "amzn1.ask.skill.72615503-5f38-4baf-b0dd-cd6edd3b6dfd"
},
"user": {
"userId": ""
},
"device": {
"deviceId": "",
"supportedInterfaces": {}
},
"apiEndpoint": "https://api.eu.amazonalexa.com",
"apiAccessToken": ""
},
"Viewport": {
"experiences": [
{
"arcMinuteWidth": 246,
"arcMinuteHeight": 144,
"canRotate": false,
"canResize": false
}
],
"shape": "RECTANGLE",
"pixelWidth": 1024,
"pixelHeight": 600,
"dpi": 160,
"currentPixelWidth": 1024,
"currentPixelHeight": 600,
"touch": [
"SINGLE"
],
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
}
},
"Viewports": [
{
"type": "APL",
"id": "main",
"shape": "RECTANGLE",
"dpi": 160,
"presentationType": "STANDARD",
"canRotate": false,
"configuration": {
"current": {
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
},
"size": {
"type": "DISCRETE",
"pixelWidth": 1024,
"pixelHeight": 600
}
}
}
}
]
},
"request": {
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.24b64895-3f90-4a5b-9805-9d3b038cd323",
"timestamp": "2020-03-29T08:59:54Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
}
I have removed the user Id, device ID and access token while asking the question for security reasons.
My Lambda node js function looks like this which i have generated using the code generator :
https://github.com/shreyneil/Episodes/blob/master/amazon-echo/lambda-function.js
Url for code-generator: http://alexa.codegenerator.s3-website-us-east-1.amazonaws.com/
Url for tutorial that i was using to implement it: https://www.youtube.com/watch?v=BB3wwxgqPOU
Whenever i try to launch the event using , open toit brewpub in my test simulator it thorws an error stating :
There was a problem with the requested skill's response
Any idea on how to make this work?
Any leads would appreciated, Thank you!

Icon is not visible on release task catalog in Azure DevOps pipeline. vss-extension.json as below,

{
"manifestVersion": 1,
"id": "build-release-task",
"name": "",
"version": "1.1.9",
"publisher": " ",
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
],
"description": "",
"categories": [
"Azure Pipelines"
],
"icons": {
"default": "images/extension-icon.png"
},
"files": [
{
"path": "buildAndReleaseTask"
},
{
"path": "images",
"addressable": true
}
],
"contributions": [
{
"id": "custom-build-release-task",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "buildAndReleaseTask",
"icon": "images/extension-icon.png"
}
}
]
}
You should put the icon file also in the task folder (where the .ts/.ps1 files).

Resources