{"record":{"id":"872ba60b51f3967d","repo":"pentaho/pentaho-kettle","slug":"gploadmeta-exception-tablenotfound","errorCode":null,"errorMessage":"GPLoadMeta.Exception.TableNotFound","messagePattern":"GPLoadMeta\\.Exception\\.TableNotFound","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadMeta.java","lineNumber":783,"sourceCode":"  }\n\n  public RowMetaInterface getRequiredFields( VariableSpace space ) throws KettleException {\n    String realTableName = space.environmentSubstitute( tableName );\n    String realSchemaName = space.environmentSubstitute( schemaName );\n\n    if ( databaseMeta != null ) {\n      Database db = new Database( loggingObject, databaseMeta );\n      try {\n        db.connect();\n\n        if ( !Utils.isEmpty( realTableName ) ) {\n          String schemaTable = databaseMeta.getQuotedSchemaTableCombination( realSchemaName, realTableName );\n\n          // Check if this table exists...\n          if ( db.checkTableExists( schemaTable ) ) {\n            return db.getTableFields( schemaTable );\n          } else {\n            throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.TableNotFound\" ) );\n          }\n        } else {\n          throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.TableNotSpecified\" ) );\n        }\n      } catch ( Exception e ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.ErrorGettingFields\" ), e );\n      } finally {\n        db.close();\n      }\n    } else {\n      throw new KettleException( BaseMessages.getString( PKG, \"GPLoadMeta.Exception.ConnectionNotDefined\" ) );\n    }\n  }\n\n  /**\n   * @return the schemaName\n   */\n  public String getSchemaName() {","sourceCodeStart":765,"sourceCodeEnd":801,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/gpload/core/src/main/java/org/pentaho/di/trans/steps/gpload/GPLoadMeta.java#L765-L801","documentation":"Thrown during GPLoadMeta's table-fields lookup (getTablleFields-style public method): after connecting to the database it checks that the quoted schema.table combination exists with db.checkTableExists(); if it does not, a KettleException with the TableNotFound message key is thrown. The library requires the target GP table to pre-exist before reading its field metadata.","triggerScenarios":"Calling getTableFields() when checkTableExists(schemaTable) returns false — the schema/table name in the step config does not match an existing table on the configured connection (or the realSchemaName/realTableName variable resolution yields a wrong name).","commonSituations":"Typo in table name; wrong schema selected; environment variable substitution resolving differently in the target environment; table not yet created on the Greenplum database; pointing at the wrong database/host.","solutions":["Create the target table in Greenplum (or run the SQL generated by the step's SQL button) before executing","Verify the Table name and Schema fields in the GPLoad dialog against the database","Test the database connection and confirm it points at the intended host/database","Check that any ${VARIABLES} in schema/table names resolve to real values in this environment"],"exampleFix":"// before\nrealTableName = \"sales_fct\"; // table does not exist\n// after\nrealTableName = \"sales_fact\"; // matches an existing table","handlingStrategy":"validation","validationCode":"// Before running: confirm the table exists on the target connection\nDatabase db = new Database(loggingObject, databaseMeta);\ndb.connect();\nif (!db.checkTableExists(schema + \".\" + table)) {\n  throw new IllegalStateException(\"Target table missing: \" + schema + \".\" + table);\n}\ndb.disconnect();","typeGuard":null,"tryCatchPattern":"try { meta.getTableFields(); } catch (KettleException e) { if (e.getMessage().contains(\"TableNotFound\")) { createTargetTable(); } else { throw e; } }","preventionTips":["Use the step's SQL button to generate/create the target table","Verify schema.table spelling against the database","Keep variable substitutions defined per environment (kettle.properties)"],"tags":["pdi","gpload","greenplum","database","table-not-found"],"backgroundTag":"entity-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}