I have nested json in MsSql Db ,i have schema DB column added and updated ,when i am trying to query dremio on the nested json with new filed which not exist in nested json ,its whould atlest give null ,same query working in ssms tools
here is the query which i have used in msql
select JSON_QUERY(payload,’$.da’) as da, * from dailyjournal_review
but failed in dremio as refrance not there
SELECT ParentEntityId,‘null’ AS new_field, Parent, UUID, Payload, newadditionalinspectionitem,additionalinspectionitem, treeStatus, additionalinspectionitemvisualinspection, CAST(failadditionalinspectionitemvisualinspectioncorrected as VARCHAR(2048)) AS failadditionalinspectionitemvisualinspectioncorrected, additionalinspectioncomments, Type, EntityTimeZone, CreatedBy, ModifiedBy, ModifiedDateTime, CreatedDateTime, SyncDateTime, CreatedByUserId, ModifiedByUserId
FROM (
SELECT “ParentEntityId”, “Parent”, “UUID”, “Payload”,“nested_0”.“Payload”[’’] AS “newadditionalinspectionitem”, “nested_0”.“Payload”[‘additionalinspectionitem’] AS “additionalinspectionitem”, “nested_0”.“Payload”[‘treeStatus’] AS “treeStatus”, “nested_0”.“Payload”[‘additionalinspectionitemvisualinspection’] AS “additionalinspectionitemvisualinspection”, “nested_0”.“Payload”[‘failadditionalinspectionitemvisualinspectioncorrected’] AS “failadditionalinspectionitemvisualinspectioncorrected”, “nested_0”.“Payload”[‘additionalinspectioncomments’] AS “additionalinspectioncomments”, “Type”, “EntityTimeZone”, “CreatedBy”, “ModifiedBy”, “ModifiedDateTime”, “CreatedDateTime”, “SyncDateTime”, “CreatedByUserId”, “ModifiedByUserId”
FROM (SELECT “ParentEntityId”, “Parent”, “UUID”, “convert_from”(“Payload”, ‘JSON’) AS “Payload”, “Type”, “EntityTimeZone”, “CreatedBy”, “ModifiedBy”, “ModifiedDateTime”, “CreatedDateTime”, “SyncDateTime”, “CreatedByUserId”, “ModifiedByUserId”
FROM “constructiontest”.“constructiontest”.“dbo”.“exhibit_additional”) AS “nested_0”
) nested_0
how to maintain dataset if any schema change in some other source