Using a map in a Big Data Batch Job
Create a Big Data Batch Job to convert a JSON input into two CSV outputs.
About this task
In this example, you have a JSON file containing information about a courses.
Each course element can contain several modules element, and each of these contains several
sections elements. The goal is to create a CSV
file containing information about modules, and another one containing the sections.
You can use the following JSON sample as
input:
[
{
"course": "Business Analytics",
"modules": [
{
"id": "4657f87c-abe6-4ec3-abb8-3d4ac721b951",
"title": "Describing and Summarizing Data",
"sections": [
{
"id": "6fd75dff-aa6e-45ad-bc2a-7abc7268a5ac",
"title": "1.1 Introduction"
},
{
"id": "e18d6e8a-8bf1-46bc-89cb-7812a48bb2af",
"title": "1.2 Visualizing Data"
},
{
"id": "02e3c316-a136-4c18-a01c-ab97bb51c255",
"title": "1.3 Descriptive Statistics"
},
{
"id": "e5b4d067-aae7-41c0-b8fe-46fe6aee9924",
"title": "Module 1 Quiz"
}
]
},
{
"id": "347eddf2-1307-4a7f-84e0-1f56093e8b9c",
"title": "Sampling and Estimation",
"sections": [
{
"id": "807fef96-b140-45bc-8006-cd872ee3bcb0",
"title": "2.1 Creating Representative and Unbiased Samples"
},
{
"id": "9703cdf7-1749-4d17-8e4d-a4083496eafa",
"title": "2.2 The Normal Distribution"
},
{
"id": "976af36f-20e4-488d-b92d-e9adec2736f5",
"title": "2.3 Confidence Intervals"
},
{
"id": "e19a155d-7d94-4825-9376-c5e5832f26d7",
"title": "Module 2 Quiz"
}
]
}
]
},
{
"course": "Computer Science",
"modules": [
{
"id": "ccea3e72-afe7-40ef-9ce2-de4ac33e93df",
"title": "Languages and Data Structures",
"sections": [
{
"id": "7f885df5-90b5-43ca-bd06-870d93590854",
"title": "1.1 Introduction"
},
{
"id": "1acc356f-8ad3-46cd-8c66-69252db7f2d9",
"title": "1.2 Algorithm Analysis"
},
{
"id": "cdbfc79e-2956-4894-9d8e-d571a28d7f75",
"title": "1.3 Abstract Data Types"
},
{
"id": "53a2d237-18c3-414c-86a8-bc82512ad71f",
"title": "Module 1 Quiz"
}
]
}
]
},
{
"course": "Management",
"modules": [
{
"id": "klea3e72-afe7-40ef-8rd9-de4ac33e93gt",
"title": "Management and Organizational Behavior",
"sections": [
{
"id": "9a885df5-72a1-43ca-bd06-870d93590889",
"title": "1.1 Introduction"
},
{
"id": "6bcc356f-2fx3-46cd-8c66-69252db7f2f8",
"title": "1.2 Cultural Values and Diversity"
},
{
"id": "pabfc79e-9654-4894-9d8e-d571a28d7f21",
"title": "1.3 Managing a Global Team"
},
{
"id": "61a2d237-56n6-414c-86a8-bc82512ad79m",
"title": "Module 1 Quiz"
}
]
}
]
}
]