6 Replies Latest reply on May 11, 2017 4:33 AM by Kulbhushan Chaskar

    Got DuplicateRecordException when trying to deploy VDB of teradata

    Kulbhushan Chaskar Expert

      Hi,

       

      connection from teradata is made successfully, but when i am trying to deploy VDB i got this exception:-

       

      17:20:30,190 WARN  [org.teiid.RUNTIME] (Worker0_async-teiid-threads0)  TEIID5003

      6 VDB SvcSourceVdb_TESTDSTERADATA20170424171722664.1 model "TESTDSTERADATA201704

      24171722664" metadata failed to load. Reason:TEIID60016 Duplicate Column TESTDST

      ERADATA20170424171722664.TDStats.StatsTbl.DatabaseId: org.teiid.metadata.Duplica

      teRecordException: TEIID60016 Duplicate Column TESTDSTERADATA20170424171722664.T

      DStats.StatsTbl.DatabaseId

              at org.teiid.metadata.MetadataFactory.addColumn(MetadataFactory.java:250

      )

              at org.teiid.translator.jdbc.JDBCMetdataProcessor.addColumn(JDBCMetdataP

      rocessor.java:449)

              at org.teiid.translator.jdbc.JDBCMetdataProcessor.processColumns(JDBCMet

      dataProcessor.java:410)

              at org.teiid.translator.jdbc.JDBCMetdataProcessor.getColumns(JDBCMetdata

      Processor.java:385)

              at org.teiid.translator.jdbc.JDBCMetdataProcessor.getTables(JDBCMetdataP

      rocessor.java:336)

              at org.teiid.translator.jdbc.JDBCMetdataProcessor.getConnectorMetadata(J

      DBCMetdataProcessor.java:166)

              at org.teiid.translator.jdbc.JDBCExecutionFactory.getMetadata(JDBCExecut

      ionFactory.java:306)

              at org.teiid.translator.jdbc.JDBCExecutionFactory.getMetadata(JDBCExecut

      ionFactory.java:69)

              at org.teiid.query.metadata.NativeMetadataRepository.getMetadata(NativeM

      etadataRepository.java:96)

              at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(Native

      MetadataRepository.java:62)

              at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(Chai

      ningMetadataRepository.java:55)

              at org.teiid.jboss.VDBService$6.run(VDBService.java:360)

              at org.teiid.jboss.VDBService$7.run(VDBService.java:411)

              at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkCon

      text.java:282)

              at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.ru

      n(ThreadReuseExecutor.java:119)

              at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseE

      xecutor.java:210)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.

      java:1142)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor

      .java:617)

              at java.lang.Thread.run(Thread.java:745)

       

      And here is my vdb,

       

      <?xml version="1.0"?>

      <vdb name="SvcSourceVdb_TESTDSTERADATA2017042415020566" version="1">

          <description>VDB for: SvcSourceVdb_TESTDSTERADATA2017042415020566, Version: 1</description>

          <connection-type>BY_VERSION</connection-type>

          <model name="TESTDSTERADATA2017042415020566" type="PHYSICAL" visible="true">

              <property name="importer.tableTypes" value="TABLE"></property>

              <source name="TESTDSTERADATA2017042415020566" translator-name="teradata" connection-jndi-name="java:/TESTDSTERADATA2017042415020566"></source>

          </model>

      </vdb>

       

      what can i do?

       

      thanks,
      kulbhushan

        • 1. Re: Got DuplicateRecordException when trying to deploy VDB of teradata
          Ramesh Reddy Master

          The importer seeing a duplicate record in your StatsTbl. What is schema for your table?

          • 2. Re: Got DuplicateRecordException when trying to deploy VDB of teradata
            Kulbhushan Chaskar Expert

            I checked TDStats is Schema and StatsTbl is table and DatabaseId is column and there is no duplicate column in this , and no data......

            And one more thing the server which i am connecting has many schemas, and i pass the schema name to teiid which i want to connect but then also it took TDStats Schema and gives me that error. so, is there any vdb problem or datasource problem,

             

            my datasource looks like.

             

            <datasource jndi-name="java:/TESTDSTERADATA20170425181515995" pool-name="TESTDSTERADATA20170425181515995">

                                <connection-url>jdbc:teradata://localhost/DATABASE=DART,DBS_PORT=1025</connection-url>

                                <driver>teradata</driver>

                                <pool>

                                    <max-pool-size>20</max-pool-size>

                                </pool>

                                <security>

                                    <user-name>root</user-name>

                                    <password>root</password>

                                </security>

            </datasource>

            • 3. Re: Got DuplicateRecordException when trying to deploy VDB of teradata
              Ramesh Reddy Master

              What is schema of the table? If you use SQL client like SQuirreL how does the table look like?

              • 4. Re: Got DuplicateRecordException when trying to deploy VDB of teradata
                Kulbhushan Chaskar Expert

                Below is my table schema......

                 

                CREATE SET TABLE TDStats.StatsTbl ,FALLBACK ,

                     NO BEFORE JOURNAL,

                     NO AFTER JOURNAL,

                     CHECKSUM = DEFAULT,

                     DEFAULT MERGEBLOCKRATIO

                     (

                      SCOID BIGINT GENERATED ALWAYS AS IDENTITY

                (START WITH 1

                            INCREMENT BY 1

                            MINVALUE -999999999999999999

                            MAXVALUE 999999999999999999

                            NO CYCLE),

                      DatabaseId BYTE(4) NOT NULL,

                      DatabaseName VARCHAR(128) CHARACTER SET UNICODE NOT CASESPECIFIC,

                      ObjectId BYTE(6) NOT NULL,

                      ObjectName VARCHAR(128) CHARACTER SET UNICODE NOT CASESPECIFIC,

                      StatsId INTEGER FORMAT '--,---,---,--9' NOT NULL,

                      StatsOrigin CHAR(1) CHARACTER SET LATIN UPPERCASE NOT CASESPECIFIC NOT NULL,

                UserImportance INTEGER NOT NULL,

                SystemImportance INTEGER NOT NULL,

                PendingThresholdSignature VARCHAR(512) CHARACTER SET LATIN NOT CASESPECIFIC,

                PendingMaxIntervals SMALLINT,

                PendingMaxValueLength INTEGER,

                PendingSampleSignature VARCHAR(256) CHARACTER SET LATIN NOT CASESPECIFIC,

                      PendingSummaryOnly CHAR(1) CHARACTER SET LATIN UPPERCASE NOT CASESPECIFIC,

                PendingForCurrentOnly INTEGER DEFAULT 0 ,

                EstProcessTime FLOAT,

                ActualProcessTime FLOAT,

                      StatsState CHAR(1) CHARACTER SET LATIN UPPERCASE NOT CASESPECIFIC NOT NULL,

                MissingFrequency INTEGER DEFAULT 0 ,

                EstPercentDataChange INTEGER DEFAULT NULL ,

                      EstimateError CHAR(1) CHARACTER SET LATIN UPPERCASE NOT CASESPECIFIC DEFAULT 'N',

                EstErrFrequency INTEGER DEFAULT 0 ,

                      QryUsageFrequency INTEGER DEFAULT 0 ,

                SubmissionSkipCnt INTEGER DEFAULT 0 ,

                ThresholdSkipCnt INTEGER DEFAULT 0 ,

                      ActiveStat CHAR(1) CHARACTER SET LATIN UPPERCASE NOT CASESPECIFIC NOT NULL,

                      ApprovedStat CHAR(1) CHARACTER SET LATIN UPPERCASE NOT CASESPECIFIC NOT NULL,

                      InActivatedOn TIMESTAMP(6) WITH TIME ZONE,

                InActiveRecommended CHAR(1) CHARACTER SET LATIN UPPERCASE NOT CASESPECIFIC,

                LastAccessedByOpt TIMESTAMP(6) WITH TIME ZONE,

                PermanentlyActive CHAR(1) CHARACTER SET LATIN UPPERCASE NOT CASESPECIFIC,

                CreateTimeStamp TIMESTAMP(6) WITH TIME ZONE NOT NULL,

                      CreateUID BYTE(4) NOT NULL,

                LastAlterTimeStamp TIMESTAMP(6) WITH TIME ZONE NOT NULL,

                      LastAlterUID BYTE(4) NOT NULL,

                      LastEvaluationTimeStamp TIMESTAMP(6) WITH TIME ZONE,

                      AutomateId BIGINT,

                      IndexNumber INTEGER,

                      FieldNames VARCHAR(10000) CHARACTER SET UNICODE NOT CASESPECIFIC)

                PRIMARY INDEX ( ObjectId )

                INDEX ( SCOID )

                INDEX ( DatabaseId );

                • 5. Re: Got DuplicateRecordException when trying to deploy VDB of teradata
                  Ramesh Reddy Master

                  Not sure what is wrong, Teiid uses JDBC's DatabaseMetadata class to import the metadata. Can you check with tools like SquirreL to see if the tables loads fine?

                  • 6. Re: Got DuplicateRecordException when trying to deploy VDB of teradata
                    Kulbhushan Chaskar Expert

                    I added property <property name="importer.schemaPattern " value="DBName"></property> in VDB and it is working , now i am able to create connection