strelec / hive-serde-schema-gen

:clipboard: Generate Hive SerDe schema from a .json file.
35 stars 12 forks source link

Error #1

Closed saurabhbidwai closed 6 years ago

saurabhbidwai commented 6 years ago

{"BND_CORP":{"ACCRUAL_DT":"12/22/2016","AMT_ISU":"400000000","ANNOUNCE_DT":"12/8/2016","CALC_TYPE":"1","CALL_TYPE":"A","CD_INSTMT_TYPE":"UNKNOWN","CHANGE_DT":"2/1/2017 16:07:29.203","COMPOUND_FLAG":"0","COUNTRY":"US","COUPON_FIX":"5.25","COUP_FREQ":"S","CPN_TYPE":"F","CURRENCY":"USD","CUSIP":"00081TAJ7","CUSIP2_set":{"CUSIP2_record":[{"CODE":"A","IDENTIFIER":"00081TAJ7"},{"CODE":"B","IDENTIFIER":"AL6700754"},{"CODE":"C","IDENTIFIER":"BZ78G47"},{"CODE":"I","IDENTIFIER":"US00081TAJ79"},{"CODE":"R","IDENTIFIER":"0x00102c5485480bae"}]},"CUSIP_ALIAS_set":{"CUSIP_ALIAS_record":[{"CODE":"8001","IDENTIFIER":"825328116","PURPOSE":"DEBTID"},{"CODE":"145986","IDENTIFIER":"F_12176095","PURPOSE":"PPMG"},{"CODE":"145986","IDENTIFIER":"F_12182768","PURPOSE":"PPMG"}]},"CUSIP_TYPE":"CUSIP","DATE_CONV":"D30360","DESC_INSTMT":"ACCO BRANDS CORP","END_ADJ_FLAG":"N","FIRST_PAY_DT":"6/15/2017","FIRST_SETTLE_DT":"12/22/2016","FLAG_144A":"Y","FLAG_CCN":"N","FLAG_CONVERT":"N","FLAG_EOM":"N","FLAG_ERISA":"N","FLAG_PERFORMING":"Y","FLAG_REG_RIGHTS":"N","ISSUER_ID":"C08578","ISSUE_DT":"12/22/2016","ISSUE_EXCHANGES_set":{"SIZE":"1","ISSUE_EXCHANGES_record":{"EXCHANGE":"NSD"}},"ISSUE_PRICE":"100","ISSUE_YIELD":"5.25","LEH_INDUSTRY":"CONS","LIQUIDITY":"L","MAKE_WHOLE_CALL":"Y","MAKE_WHOLE_SPREAD":"0.5","MARKET":"US","MARKET_ISSUE":"PUBLIC","MATURITY":"12/15/2024","MAX_CALL_NOTICE":"60","MIN_CALL_NOTICE":"30","MIN_LOT_SIZE":"1000","MIN_TRD_SIZE":"2000","MODIFIED_BY":"sm_timestamp","MTN":"N","NOTES_set":{"NOTES_record":[{"EFF_DT":"12/9/2016","INSTMT":"144A_RegRights exempt","SEQ_NUM":"1","USER_ID":"mgalati"},{"EFF_DT":"12/22/2016","INSTMT":"Reuters defined: Not yet Issued","SEQ_NUM":"0","USER_ID":"EjvDescr"},{"EFF_DT":"2/1/2017","INSTMT":"risk country per PPMG","SEQ_NUM":"10","USER_ID":"ntodorov"},{"EFF_DT":"2/21/2017","INSTMT":"144A_RegRights exempt","SEQ_NUM":"500","USER_ID":"cmay"}]},"NTL_FLAG":"N","PC_DAY_CONV":"C","PMT_ADJ_METH":"F","PMT_CAL":"NY_Bank","PMT_FREQ_TYPE":"0","PMT_LOCATION":"D","PRICE_AS_PCT":"Y","PUTCALL_set":{"PUTCALL_record":[{"DT":"12/15/2019","PRICE":"103.938","TYPE":"C"},{"DT":"12/15/2020","PRICE":"102.625","TYPE":"C"},{"DT":"12/15/2021","PRICE":"101.313","TYPE":"C"},{"DT":"12/15/2022","PRICE":"100","TYPE":"C"}]},"PUT_CALL":"C","RATING_set":{"RATING_record":[{"AGY":"1","DATE":"12/8/2016","VALUE":"B1"},{"AGY":"2","DATE":"12/8/2016","VALUE":"BB-"},{"AGY":"3","DATE":"12/8/2016","VALUE":"BB"},{"AGY":"14","DATE":"3/20/2017","VALUE":"BB-"},{"AGY":"45","DATE":"12/8/2016","VALUE":"3(55)"}]},"REVIEWED_BY":"jedinger","RISK_COUNTRY":"US","ROUND_FLAG":"R","ROUND_PRECISION":"9","SAL_INDUSTRY":"CONS","SECTOR_set":{"SECTOR_record":[{"CODE":"CONS","LEVEL":"1","SECTOR_SOURCE":"P","TYPE":"BARC_SECT"},{"CODE":"CONP","LEVEL":"1","TYPE":"ISS_ML"}]},"SEC_TYPE":"BND_CORP","SETTLE_LOCATION":"D","SM_SEC_GROUP":"BND","SM_SEC_TYPE":"CORP","STRUCTURE":"SENIOR","TICKER":"ACCO","UDF_set":{"UDF_record":[{"LABEL":"EXP_DFLT_MARGIN","PURPOSE":"PPMG","UDF_SOURCE":"PPMG","VALUE":"139.28000000000000"},{"LABEL":"FINANCIAL_SEC","PURPOSE":"MNG","UDF_SOURCE":"MNG","VALUE":"Non-Financial"},{"LABEL":"PPMG_SEDOL","PURPOSE":"PPMG","UDF_SOURCE":"PPMG","VALUE":"9885662"}]},"UNITS":"BONDS","WI_FLAG":"N"}} {"BND_CORP":{"ACCRUAL_DT":"6/4/2015","AMT_ISU":"1000000000","ANNOUNCE_DT":"5/28/2015","CALC_TYPE":"1","CALL_MANDATORY":"N","CD_INSTMT_TYPE":"UNKNOWN","CHANGE_DT":"2/1/2017 16:07:15.670","COMPOUND_FLAG":"0","COUNTRY":"NL","COUPON_FIX":"2.45","COUP_FREQ":"S","CPN_TYPE":"F","CURRENCY":"USD","CUSIP":"00084DAJ9","CUSIP2_set":{"CUSIP2_record":[{"CODE":"B","IDENTIFIER":"EK9442097"},{"CODE":"C","IDENTIFIER":"BYR8K93"},{"CODE":"I","IDENTIFIER":"US00084DAJ90"}]},"CUSIP_ALIAS_set":{"CUSIP_ALIAS_record":[{"CODE":"8001","IDENTIFIER":"824536165","PURPOSE":"DEBTID"},{"CODE":"145986","IDENTIFIER":"F_10345013","PURPOSE":"PPMG"}]},"CUSIP_TYPE":"CUSIP","DATE_CONV":"D30360","DESC_INSTMT":"ABN AMRO BANK NV","END_ADJ_FLAG":"N","FIRST_PAY_DT":"12/4/2015","FIRST_SETTLE_DT":"6/4/2015","FLAG_144A":"Y","FLAG_EOM":"N","FLAG_ERISA":"N","FLAG_PERFORMING":"Y","FLAG_REG_RIGHTS":"N","ISSUER_ID":"E97445","ISSUE_DT":"6/4/2015","ISSUE_EXCHANGES_set":{"ISSUE_EXCHANGES_record":[{"EXCHANGE":"AEX"},{"EXCHANGE":"NSD"}]},"ISSUE_PRICE":"99.78","LEH_INDUSTRY":"BANK","LIQUIDITY":"L","MARKET":"US","MATURITY":"6/4/2020","MIN_LOT_SIZE":"1000","MIN_TRD_SIZE":"200000","MODIFIED_BY":"sm_timestamp","MTN":"Y","NOTES_set":{"NOTES_record":[{"EFF_DT":"6/1/2015","INSTMT":"144A_RegRights exempt","SEQ_NUM":"2","USER_ID":"alogan"},{"EFF_DT":"1/1/2016","INSTMT":"144A_RegRights exempt","SEQ_NUM":"2","USER_ID":"alogan"},{"EFF_DT":"2/1/2017","INSTMT":"risk country per PPMG","SEQ_NUM":"10","USER_ID":"ntodorov"}]},"NTL_FLAG":"N","PC_DAY_CONV":"B","PMT_ADJ_METH":"F","PMT_CAL":"NY_Bank","PMT_FREQ_TYPE":"0","PMT_LOCATION":"D","PRICE_AS_PCT":"Y","PUT_CALL":" ","PUT_MANDATORY":"N","RATING_set":{"RATING_record":[{"AGY":"1","DATE":"5/20/2016","VALUE":"A1"},{"AGY":"2","DATE":"5/29/2015","VALUE":"A"},{"AGY":"3","DATE":"2/24/2017","VALUE":"A+"},{"AGY":"14","DATE":"3/20/2017","VALUE":"A-"}]},"REVIEWED_BY":"mtang","RISK_COUNTRY":"NL","ROUND_FLAG":"R","ROUND_PRECISION":"9","SAL_INDUSTRY":"BANK","SECTOR_set":{"SECTOR_record":[{"CODE":"BANK","LEVEL":"1","SECTOR_SOURCE":"P","TYPE":"BARC_SECT"},{"CODE":"BANK","LEVEL":"1","TYPE":"ISS_ML"}]},"SEC_TYPE":"BND_CORP","SETTLE_LOCATION":"D","SINK_MANDATORY":"N","SM_SEC_GROUP":"BND","SM_SEC_TYPE":"CORP","STRUCTURE":"SENIOR","TICKER":"ABNANV","UDF_set":{"UDF_record":[{"LABEL":"EXP_DFLT_MARGIN","PURPOSE":"PPMG","UDF_SOURCE":"PPMG","VALUE":"10.54000000000000"},{"LABEL":"FINANCIAL_SEC","PURPOSE":"MNG","UDF_SOURCE":"MNG","VALUE":"Financial"},{"LABEL":"PPMG_SEDOL","PURPOSE":"PPMG","VALUE":"BYR8K93"}]},"UNITS":"BONDS","WI_FLAG":"N"}} {"BND_CORP":{"ACCRUAL_DT":"6/4/2015","AMT_ISU":"500000000","ANNOUNCE_DT":"5/28/2015","CALC_TYPE":"1","CALL_MANDATORY":"N","CD_INSTMT_TYPE":"UNKNOWN","CHANGE_DT":"11/5/2016 8:11:21.253","COMPOUND_FLAG":"0","COUNTRY":"NL","COUPON_FIX":"1.8","COUP_FREQ":"S","CPN_TYPE":"F","CURRENCY":"USD","CUSIP":"00084DAK6","CUSIP2_set":{"CUSIP2_record":[{"CODE":"B","IDENTIFIER":"EK9442030"},{"CODE":"C","IDENTIFIER":"BYYT691"},{"CODE":"I","IDENTIFIER":"US00084DAK63"}]},"CUSIP_ALIAS_set":{"CUSIP_ALIAS_record":[{"CODE":"145986","IDENTIFIER":"10349297","PURPOSE":"PPMG"},{"CODE":"8001","IDENTIFIER":"824536164","PURPOSE":"DEBTID"},{"CODE":"145986","IDENTIFIER":"F_10349297","PURPOSE":"PPMG"}]},"CUSIP_TYPE":"CUSIP","DATE_CONV":"D30360","DESC_INSTMT":"ABN AMRO BANK NV","END_ADJ_FLAG":"N","FIRST_PAY_DT":"12/4/2015","FIRST_SETTLE_DT":"6/4/2015","FLAG_144A":"Y","FLAG_EOM":"N","FLAG_ERISA":"N","FLAG_PERFORMING":"Y","FLAG_REG_RIGHTS":"N","ISSUER_ID":"E97445","ISSUE_DT":"6/4/2015","ISSUE_EXCHANGES_set":{"ISSUE_EXCHANGES_record":[{"EXCHANGE":"AEX"},{"EXCHANGE":"NSD"}]},"ISSUE_PRICE":"99.93899999999999","LEH_INDUSTRY":"BANK","LIQUIDITY":"L","MARKET":"US","MATURITY":"6/4/2018","MIN_LOT_SIZE":"1000","MIN_TRD_SIZE":"200000","MODIFIED_BY":"sm_timestamp","MTN":"Y","NOTES_set":{"SIZE":"1","NOTES_record":{"EFF_DT":"10/28/2016","INSTMT":"144A_RegRights exempt","SEQ_NUM":"1","USER_ID":"kmanning"}},"NTL_FLAG":"N","PMT_ADJ_METH":"F","PMT_CAL":"NY_Bank","PMT_FREQ_TYPE":"0","PMT_LOCATION":"D","PRICE_AS_PCT":"Y","PUT_CALL":" ","PUT_MANDATORY":"N","RATING_set":{"RATING_record":[{"AGY":"1","DATE":"5/20/2016","VALUE":"A1"},{"AGY":"2","DATE":"5/29/2015","VALUE":"A"},{"AGY":"3","DATE":"2/24/2017","VALUE":"A+"},{"AGY":"14","DATE":"3/20/2017","VALUE":"A-"}]},"REVIEWED_BY":"mtang","ROUND_FLAG":"R","ROUND_PRECISION":"9","SAL_INDUSTRY":"BANK","SECTOR_set":{"SECTOR_record":[{"CODE":"BANK","LEVEL":"1","SECTOR_SOURCE":"P","TYPE":"BARC_SECT"},{"CODE":"BANK","LEVEL":"1","TYPE":"ISS_ML"}]},"SEC_TYPE":"BND_CORP","SETTLE_CAL":"US_BMA","SETTLE_LOCATION":"D","SINK_MANDATORY":"N","SM_SEC_GROUP":"BND","SM_SEC_TYPE":"CORP","STRUCTURE":"SENIOR","TICKER":"ABNANV","UDF_set":{"UDF_record":[{"LABEL":"FINANCIAL_SEC","PURPOSE":"MNG","UDF_SOURCE":"MNG","VALUE":"Financial"},{"LABEL":"MAGREC_ASSET","PURPOSE":"BRS","VALUE":"Non-Government Bonds"},{"LABEL":"PPMG_SEDOL","PURPOSE":"PPMG","UDF_SOURCE":"PPMG","VALUE":"9757697"}]},"UNITS":"BONDS","WI_FLAG":"N"}} {"BND_CORP":{"ACCRUAL_DT":"1/18/2017","AMT_ISU":"1000000000","ANNOUNCE_DT":"1/11/2017","CALC_TYPE":"1","CD_INSTMT_TYPE":"UNKNOWN","CHANGE_DT":"2/1/2017 16:06:06.450","COMPOUND_FLAG":"0","COUNTRY":"NL","COUPON_FIX":"2.1","COUP_FREQ":"S","CPN_TYPE":"F","CURRENCY":"USD","CUSIP":"00084DAN0","CUSIP2_set":{"CUSIP2_record":[{"CODE":"A","IDENTIFIER":"00084DAN0"},{"CODE":"B","IDENTIFIER":"AM1164467"},{"CODE":"C","IDENTIFIER":"BDHTRY3"},{"CODE":"I","IDENTIFIER":"US00084DAN03"},{"CODE":"R","IDENTIFIER":"0x00102cef3cc00b24"}]},"CUSIP_ALIAS_set":{"CUSIP_ALIAS_record":[{"CODE":"8001","IDENTIFIER":"825412314","PURPOSE":"DEBTID"},{"CODE":"145986","IDENTIFIER":"F_12278127","PURPOSE":"PPMG"},{"CODE":"145986","IDENTIFIER":"F_12279587","PURPOSE":"PPMG"}]},"CUSIP_TYPE":"CUSIP","DATE_CONV":"30E360","DESC_INSTMT":"ABN AMRO BANK NV","END_ADJ_FLAG":"N","FIRST_PAY_DT":"7/18/2017","FIRST_SETTLE_DT":"1/18/2017","FLAG_144A":"Y","FLAG_CCN":"N","FLAG_CONVERT":"N","FLAG_EOM":"N","FLAG_ERISA":"N","FLAG_PERFORMING":"Y","FLAG_REG_RIGHTS":"N","ISSUER_ID":"E97445","ISSUE_DT":"1/18/2017","ISSUE_EXCHANGES_set":{"ISSUE_EXCHANGES_record":[{"EXCHANGE":"AEX"},{"EXCHANGE":"NSD"}]},"ISSUE_PRICE":"99.986","ISSUE_YIELD":"2.107","LEH_INDUSTRY":"BANK","LIQUIDITY":"L","MARKET":"US","MARKET_ISSUE":"PRIVATE","MATURITY":"1/18/2019","MIN_LOT_SIZE":"1000","MIN_TRD_SIZE":"200000","MODIFIED_BY":"sm_timestamp","MTN":"N","NOTES_set":{"NOTES_record":[{"EFF_DT":"1/12/2017","INSTMT":"144A_RegRights exempt","SEQ_NUM":"1","USER_ID":"mgalati"},{"EFF_DT":"1/18/2017","INSTMT":"Reuters defined: Not yet Issued","SEQ_NUM":"0","USER_ID":"EjvDescr"},{"EFF_DT":"2/21/2017","INSTMT":"144A_RegRights exempt","SEQ_NUM":"500","USER_ID":"cmay"}]},"NTL_FLAG":"N","PMT_ADJ_METH":"F","PMT_CAL":"NY_Bank","PMT_FREQ_TYPE":"0","PMT_LOCATION":"D","PRICE_AS_PCT":"Y","PUT_CALL":" ","RATING_set":{"RATING_record":[{"AGY":"1","DATE":"1/13/2017","VALUE":"A1"},{"AGY":"2","DATE":"1/13/2017","VALUE":"A"},{"AGY":"3","DATE":"2/24/2017","VALUE":"A+"},{"AGY":"14","DATE":"3/20/2017","VALUE":"A-"}]},"REVIEWED_BY":"eucho","RISK_COUNTRY":"NL","ROUND_FLAG":"R","ROUND_PRECISION":"9","SAL_INDUSTRY":"BANK","SECTOR_set":{"SECTOR_record":[{"CODE":"BANK","LEVEL":"1","SECTOR_SOURCE":"P","TYPE":"BARC_SECT"},{"CODE":"BANK","LEVEL":"1","SECTOR_SOURCE":"P","TYPE":"ISS_ML"}]},"SEC_TYPE":"BND_CORP","SETTLE_LOCATION":"D","SM_SEC_GROUP":"BND","SM_SEC_TYPE":"CORP","STRUCTURE":"SENIOR","TICKER":"ABNANV","UDF_set":{"UDF_record":[{"LABEL":"EXP_DFLT_MARGIN","PURPOSE":"PPMG","UDF_SOURCE":"PPMG","VALUE":"6.68000000000000"},{"LABEL":"FINANCIAL_SEC","PURPOSE":"MNG","UDF_SOURCE":"MNG","VALUE":"Financial"},{"LABEL":"PPMG_SEDOL","PURPOSE":"PPMG","UDF_SOURCE":"PPMG","VALUE":"9892413"}]},"UNITS":"BONDS","WI_FLAG":"N"}} {"BND_CORP":{"ACCRUAL_DT":"1/15/2013","AMT_ISU":"1000000000","ANNOUNCE_DT":"4/1/2013","CALC_TYPE":"1","CD_INSTMT_TYPE":"UNKNOWN","CHANGE_DT":"12/14/2016 18:36:56.866","COMPOUND_FLAG":"0","COUNTRY":"US","COUPON_FIX":"3.5","COUP_FREQ":"S","CPN_TYPE":"F","CURRENCY":"USD","CUSIP":"00101JAF3","CUSIP2_set":{"CUSIP2_record":[{"CODE":"A","IDENTIFIER":"00101JAF3"},{"CODE":"B","IDENTIFIER":"EJ6176642"},{"CODE":"C","IDENTIFIER":"B8DRVX3"},{"CODE":"I","IDENTIFIER":"US00101JAF30"},{"CODE":"R","IDENTIFIER":"0x0004051209ec00f6"},{"CODE":"W","IDENTIFIER":"A1HJB8"}]},"CUSIP_ALIAS_set":{"CUSIP_ALIAS_record":[{"CODE":"145986","IDENTIFIER":"8165129","PURPOSE":"PPMG"},{"CODE":"8001","IDENTIFIER":"823180014","PURPOSE":"DEBTID"},{"CODE":"145986","IDENTIFIER":"F_8165129","PURPOSE":"PPMG"}]},"CUSIP_TYPE":"CUSIP","DATE_CONV":"D30360","DESC_INSTMT":"ADT CORP","END_ADJ_FLAG":"N","FIRST_PAY_DT":"7/15/2013","FIRST_SETTLE_DT":"4/29/2013","FLAG_144A":"N","FLAG_CONVERT":"N","FLAG_EOM":"N","FLAG_ERISA":"N","FLAG_PERFORMING":"Y","FLAG_REG_RIGHTS":"N","ISSUER_ID":"F89552","ISSUE_DT":"4/29/2013","ISSUE_EXCHANGES_set":{"ISSUE_EXCHANGES_record":[{"EXCHANGE":"BER"},{"EXCHANGE":"DUS"},{"EXCHANGE":"FRA"},{"EXCHANGE":"MKX"},{"EXCHANGE":"NSD"}]},"ISSUE_YIELD":"0","LAST_REGULAR_PMT":"1/15/2022","LEAD_MGR":"CIT","LEH_INDUSTRY":"SERV","LIQUIDITY":"L","MARKET":"GLBL","MARKET_ISSUE":"PUBLIC","MATURITY":"7/15/2022","MIN_LOT_SIZE":"1000","MIN_TRD_SIZE":"2000","MODIFIED_BY":"sm_timestamp","MTN":"N","NTL_FLAG":"N","PMT_ADJ_METH":"F","PMT_CAL":"NY_Bank","PMT_FREQ_TYPE":"0","PRICE_AS_PCT":"Y","PUT_CALL":"W","RATING_set":{"RATING_record":[{"AGY":"1","DATE":"2/3/2017","VALUE":"Ba3"},{"AGY":"2","DATE":"7/31/2013","VALUE":"BB-"},{"AGY":"3","DATE":"5/2/2016","VALUE":"NR"},{"AGY":"14","DATE":"3/20/2017","VALUE":"BBB"},{"AGY":"45","DATE":"5/3/2016","VALUE":"2(75)"},{"AGY":"51","DATE":"8/19/2013","VALUE":"NR"},{"AGY":"53","DATE":"5/2/2016","VALUE":"NR"}]},"REVIEWED_BY":"kevgibso","ROUND_FLAG":"R","ROUND_PRECISION":"9","SAL_INDUSTRY":"OTHS","SECTOR_set":{"SECTOR_record":[{"CODE":"SERV","LEVEL":"1","SECTOR_SOURCE":"P","TYPE":"BARC_SECT"},{"CODE":"SUPP","LEVEL":"1","SECTOR_SOURCE":"P","TYPE":"ISS_ML"}]},"SEC_TYPE":"BND_CORP","SM_SEC_GROUP":"BND","SM_SEC_TYPE":"CORP","STRUCTURE":"SENIOR","TICKER":"ADT","UDF_set":{"SIZE":"1","UDF_record":{"LABEL":"FINANCIAL_SEC","PURPOSE":"MNG","UDF_SOURCE":"MNG","VALUE":"Non-Financial"}},"UNITS":"BONDS","WI_FLAG":"N"}}

this is my sample json file, and i've tried this tool but getting an error

run SM_Sample-list.json [info] Running Generator SM_Sample-list.json [error] (run-main-4) On the line 2 you attempted to insert this JSON: [error] [ { [error] "EXCHANGE" : "AEX" [error] }, { [error] "EXCHANGE" : "NSD" [error] } ] [error] with the corresponding schema: [error] ARRAY< [error] STRUCT< [error] EXCHANGE: VARCHAR(3) [error] > [error] > [error] into the schema with this signature: [error] STRUCT< [error] EXCHANGE: VARCHAR(3) [error] > On the line 2 you attempted to insert this JSON: [ { "EXCHANGE" : "AEX" }, { "EXCHANGE" : "NSD" } ] with the corresponding schema: ARRAY< STRUCT< EXCHANGE: VARCHAR(3)

into the schema with this signature: STRUCT< EXCHANGE: VARCHAR(3)

at schemer.Schemer.merge(Schemer.scala:61) at schemer.Schemer$$anonfun$merge$2.apply(Schemer.scala:58) at schemer.Schemer$$anonfun$merge$2.apply(Schemer.scala:56) at scala.collection.MapLike$MappedValues$$anonfun$foreach$3.apply(MapLike.scala:245) at scala.collection.MapLike$MappedValues$$anonfun$foreach$3.apply(MapLike.scala:245) at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:733) at scala.collection.immutable.Map$Map2.foreach(Map.scala:137) at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:732) at scala.collection.MapLike$MappedValues.foreach(MapLike.scala:245) at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:59) at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:104) at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:48) at scala.collection.TraversableOnce$class.copyToBuffer(TraversableOnce.scala:275) at scala.collection.AbstractTraversable.copyToBuffer(Traversable.scala:104) at scala.collection.MapLike$class.toBuffer(MapLike.scala:326) at scala.collection.AbstractMap.toBuffer(Map.scala:59) at scala.collection.MapLike$class.toSeq(MapLike.scala:323) at scala.collection.AbstractMap.toSeq(Map.scala:59) at schemer.Schemer.merge(Schemer.scala:59) at schemer.Schemer$$anonfun$merge$2.apply(Schemer.scala:58) at schemer.Schemer$$anonfun$merge$2.apply(Schemer.scala:56) at scala.collection.MapLike$MappedValues$$anonfun$foreach$3.apply(MapLike.scala:245) at scala.collection.MapLike$MappedValues$$anonfun$foreach$3.apply(MapLike.scala:245) at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:733) at scala.collection.immutable.HashMap$HashMap1.foreach(HashMap.scala:221) at scala.collection.immutable.HashMap$HashTrieMap.foreach(HashMap.scala:428) at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:732) at scala.collection.MapLike$MappedValues.foreach(MapLike.scala:245) at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:59) at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:104) at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:48) at scala.collection.TraversableOnce$class.copyToBuffer(TraversableOnce.scala:275) at scala.collection.AbstractTraversable.copyToBuffer(Traversable.scala:104) at scala.collection.MapLike$class.toBuffer(MapLike.scala:326) at scala.collection.AbstractMap.toBuffer(Map.scala:59) at scala.collection.MapLike$class.toSeq(MapLike.scala:323) at scala.collection.AbstractMap.toSeq(Map.scala:59) at schemer.Schemer.merge(Schemer.scala:59) at schemer.Schemer$$anonfun$merge$2.apply(Schemer.scala:58) at schemer.Schemer$$anonfun$merge$2.apply(Schemer.scala:56) at scala.collection.MapLike$MappedValues$$anonfun$foreach$3.apply(MapLike.scala:245) at scala.collection.MapLike$MappedValues$$anonfun$foreach$3.apply(MapLike.scala:245) at scala.collection.TraversableLike$WithFilter$$anonfun$foreach$1.apply(TraversableLike.scala:733) at scala.collection.immutable.Map$Map1.foreach(Map.scala:116) at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:732) at scala.collection.MapLike$MappedValues.foreach(MapLike.scala:245) at scala.collection.generic.Growable$class.$plus$plus$eq(Growable.scala:59) at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:104) at scala.collection.mutable.ArrayBuffer.$plus$plus$eq(ArrayBuffer.scala:48) at scala.collection.TraversableOnce$class.copyToBuffer(TraversableOnce.scala:275) at scala.collection.AbstractTraversable.copyToBuffer(Traversable.scala:104) at scala.collection.MapLike$class.toBuffer(MapLike.scala:326) at scala.collection.AbstractMap.toBuffer(Map.scala:59) at scala.collection.MapLike$class.toSeq(MapLike.scala:323) at scala.collection.AbstractMap.toSeq(Map.scala:59) at schemer.Schemer.merge(Schemer.scala:59) at schemer.Schemer$$anonfun$1.apply(Schemer.scala:13) at schemer.Schemer$$anonfun$1.apply(Schemer.scala:11) at scala.collection.Iterator$class.foreach(Iterator.scala:893) at scala.collection.AbstractIterator.foreach(Iterator.scala:1336) at schemer.Schemer.(Schemer.scala:11) at Generator$.delayedEndpoint$Generator$1(Generator.scala:6) at Generator$delayedInit$body.apply(Generator.scala:3) at scala.Function0$class.apply$mcV$sp(Function0.scala:34) at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12) at scala.App$$anonfun$main$1.apply(App.scala:76) at scala.App$$anonfun$main$1.apply(App.scala:76) at scala.collection.immutable.List.foreach(List.scala:381) at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35) at scala.App$class.main(App.scala:76) at Generator$.main(Generator.scala:3) at Generator.main(Generator.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) [trace] Stack trace suppressed: run last compile:run for the full output. java.lang.RuntimeException: Nonzero exit code: 1 at scala.sys.package$.error(package.scala:27) [trace] Stack trace suppressed: run last compile:run for the full output. [error] (compile:run) Nonzero exit code: 1 [error] Total time: 1 s, completed Nov 24, 2017 3:35:13 AM

strelec commented 6 years ago

Your schema is not consistent. In the first JSON, you have this:

"ISSUE_EXCHANGES_record":{"EXCHANGE":"NSD"}

Later on, you try to insert this:

"ISSUE_EXCHANGES_record":[{"EXCHANGE":"AEX"},{"EXCHANGE":"NSD"}]

A struct and an array of structs is not the same.