loadData + Column Type JSONB is having problem

Hi,
I have a Changelog file (Json format) and trying to do a loadData command for one of the tables with Column Type as JSONB (postgresql DB) but I am getting the below error:

Caused by: liquibase.exception.UnexpectedLiquibaseException: loadData type of ‘jsonb’ ’ is not supported. Please use BOOLEAN, NUMERIC, DATE, STRING, COMPUTED, SEQUENCE, UUID or SKIP

I am using the liquibase-core-3.8.4.jar

any suggestions?

Hello @NavazaKhan ,

Sorry you are facing issues using liquibase. May we see some more info to diagnose? Would you please provide:

  • liquibase command line you are running
  • if you are using liquibase.properties file, please post those contents as well (pls redact any confidential data like passwords)
  • complete log (need more than the snippet provided)
  • the exact changeset you are using that creates this error.

Thanks, looking forward to helping you solve!

Ronak

I am using Springboot to invoke Liquibase;

here is the details (1) Change Log (2) Example Data (3) Error Log


Change Log:

databaseChangeLog:

  • changeSet:
    id: 48
    author: UR5L
    comment: Load Data into TCUSTM_REQUEST
    changes:
    - loadData:
    commnet: load data from CSV file into Table TCUSTM_REQUEST
    columns:
    - column:
    header: header1
    name: CUSTM_REQUEST_ID
    type: NUMERIC
    - column:
    header: header2
    name: CUSTM_REQST_TX
    type: jsonb
    - column:
    header: header3
    name: LST_UPDTD_TS
    type: TIMESTAMP(6) WITHOUT TIME ZONE
    commentLineStartsWith: //
    encoding: UTF-8
    file: …/sql/AU/TCUSTM_REQUEST.csv
    quotchar: ‘"’
    relativeToChangelogFile: true
    separator: ‘,’
    schemaName: public
    tableName: TCUSTM_REQUEST
    usePreparedStatements: true
    rollback:
    - delete:
    schemaName: public
    tableName: TCUSTM_REQUEST

Example Data Set:

“CUSTM_REQUEST_ID”,“CUSTM_REQST_TX”,“LST_UPDTD_TS”
1007799,"{"“traderPin”":"“BADW”","“firmName”":"“Citigroup AU New Firm”","“userFirstName”":"“Faisal”","“userLastName”":"“Ejaz”","“deskName”":"“Default”","“fundShortName”":"“Australian Corporate Fixed Interest Index ETF”","“unitSize”":30000}",“CMPL”,“2020-09-16 02:58:38.916921”


Error Log:

Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set db/changelog/changes/2021/01/06/changelog/db.changelog-2021-01-08.yaml::48::UR5L:
Reason: liquibase.exception.UnexpectedLiquibaseException: loadData type of ‘jsonb’ ’ is not supported. Please use BOOLEAN, NUMERIC, DATE, STRING, COMPUTED, SEQUENCE, UUID or SKIP
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:646) ~[liquibase-core-3.8.4.jar:?]
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:53) ~[liquibase-core-3.8.4.jar:?]
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:83) ~[liquibase-core-3.8.4.jar:?]
at liquibase.Liquibase.update(Liquibase.java:202) ~[liquibase-core-3.8.4.jar:?]
at liquibase.Liquibase.update(Liquibase.java:179) ~[liquibase-core-3.8.4.jar:?]
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:366) ~[liquibase-core-3.8.4.jar:?]
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:314) ~[liquibase-core-3.8.4.jar:?]
at com.vanguard.tip.gem.webservice.config.LiquibaseConfig.runMigration(LiquibaseConfig.java:110) ~[classes/:?]
at com.vanguard.tip.gem.webservice.config.LiquibaseConfig.initialise(LiquibaseConfig.java:89) ~[classes/:?]
at com.vanguard.tip.gem.webservice.config.LiquibaseConfig$$EnhancerBySpringCGLIB$$c69b5a62.CGLIB$initialise$0() ~[classes/:?]
at com.vanguard.tip.gem.webservice.config.LiquibaseConfig$$EnhancerBySpringCGLIB$$c69b5a62$$FastClassBySpringCGLIB$$535f5652.invoke() ~[classes/:?]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228) ~[spring-core-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:356) ~[spring-context-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at com.vanguard.tip.gem.webservice.config.LiquibaseConfig$$EnhancerBySpringCGLIB$$c69b5a62.initialise() ~[classes/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_261]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_261]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_261]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_261]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:588) ~[spring-beans-4.3.4.RELEASE.jar:4.3.4.RELEASE]
… 16 more