Go Back
Nested Object Schemas
Publisher
: Lingk
Run In Lingk
Description
Process data with nested objects easily by applying a schema to connectors. Schemas are necessary for selecting *Null* columns in staged, in-memory tables.
Browse the knowledge base
Twitter
E-Mail
# _____ _ _____ __ # | __ \ (_) |_ _| / _| # | |__) |___ ___ _ _ __ ___ | | _ __ | |_ ___ # | _ // _ \/ __| | '_ \ / _ \ | | | '_ \| _/ _ \ # | | \ \ __/ (__| | |_) | __/ _| |_| | | | || (_) | # |_| \_\___|\___|_| .__/ \___| |_____|_| |_|_| \___/ # | | # |_| # Project Name - NESTED OBJECT SCHEMAS # Recipe URL - https://app.lingk.io/a/10932/tf/17883 # Description - # Process data with nested objects easily by applying a schema to connectors. Schemas are necessary for selecting *Null* columns in staged, in-memory tables. # Industry - Higher Ed # Business Process - Graduate Reporting # Systems - # Connectors - JSON # Data Flows - Single Direction # Connection Type - JSON # Add Recipe notes / Change log information here! # _____ _ # / ____| | | # | | ___ _ __ _ __ ___ ___| |_ ___ _ __ ___ # | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__/ __| # | |___| (_) | | | | | | | __/ (__| || (_) | | \__ \ # \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_| |___/ # # CONNECTORS specify what data will be pulled into the in-memory database during processing connectors: # JSON Setup - https://help.lingk.io/en/articles/74-json-connector-reference ###### Start: JSON Connectors ####### - name: goodCourseReader type: json schemaRef: courseSchema properties: jsonObject: > [ {"name": "Spanish 101", "courseNumber": 12345, "undergrad": true, "meetingTimes": ["12:00" ], "someObject": {"a":"b", "c":"d", "q": "r"}}, {"name": "Spanish 102", "courseNumber": 12346, "undergrad": true, "meetingTimes": ["13:00", "17:00"]}, {"name": "Spanish 201", "courseNumber": 12355, "undergrad": false} ] schemas: - name: courseSchema fields: - name: name type: String required: true - name: courseNumber type: Long - name: undergrad type: Boolean - name: meetingTimes type: Array items: type: String - name: object1 type: Object objectSchema: name: asdf fields: - name: asdf type: String required: false - name: someObject type: Object objectSchema: name: myObjectDef fields: - name: a type: String required: false - name: c type: String - name: obj type: Object objectSchema: name: subObject fields: - name: z type: String required: false ###### End: JSON Connectors ####### # _____ _ _ _ # / ____| | | | | | # | (___ | |_ __ _| |_ ___ _ __ ___ ___ _ __ | |_ ___ # \___ \| __/ _` | __/ _ \ '_ ` _ \ / _ \ '_ \| __/ __| # ____) | || (_| | || __/ | | | | | __/ | | | |_\__ \ # |_____/ \__\__,_|\__\___|_| |_| |_|\___|_| |_|\__|___/ # STATEMENTS specify how the data should be processed while in memory statements: #******************************************************************** D I S C L A I M E R *********************************************************************************************** # * # Note that in an effort to keep recipes optimized for DPH (Data Processing Hours), print statements should be commented out after development has concluded for a recipe. * # For more information on DPH optimization, please visit the following help article - https://help.lingk.io/en/articles/212-minimizing-data-processing-hours-on-the-lingk-platform * # * #******************************************************************** D I S C L A I M E R *********************************************************************************************** # Print the object schema from the example so that you don't need to create one by hand #- statement: printschema goodCourseReader # - statement: (goodCourse) => select * from goodCourseReader # - statement: (good1, bad1) => validate goodCourse with schema courseSchema # - statement: print good1 # - statement: print bad1 # - statement: (meetingTimes) => select courseNumber, meetingTimes[0], if(meetingTimes[1] is null,"",meetingTimes[1]) meetingTime1 from good1 # - statement: print meetingTimes # - statement: (icanfilter) => select courseNumber, meetingTimes from good1 where meetingTimes[0] = '12:00' # - statement: print icanfilter # - statement: (filterObject) => select name from good1 where someObject.a = 'b' # - statement: print filterObject # - statement: (objectValue) => select name as a, someObject.a as b from good1 where someObject.a = 'b' # - statement: print objectValue - statement: (asdf) => select object1.asdf from goodCourseReader #- statement: print asdf - statement: (z) => select someObject.a from goodCourseReader #- statement: print z - statement: (zz) => select someObject.obj from goodCourseReader #- statement: print zz # Add more statements to convert, join, aggregrate, transform, and integrate your data
Ellucian Ethos Reader
Transformation Examples