congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
HCatException.getMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getMessage
method
in
org.apache.hive.hcatalog.common.HCatException

Best Java code snippets using org.apache.hive.hcatalog.common.HCatException.getMessage (Showing top 15 results out of 315)

origin: apache/hive

@Override
public String toString() {
 return getMessage();
}
origin: apache/hive

 /** Constructs HCatSchema from pigSchema. Passed tableSchema is the existing
  * schema of the table in metastore.
  */
 protected HCatSchema convertPigSchemaToHCatSchema(Schema pigSchema, HCatSchema tableSchema) throws FrontendException {
  if(LOG.isDebugEnabled()) {
   LOG.debug("convertPigSchemaToHCatSchema(pigSchema,tblSchema)=(" + pigSchema + "," + tableSchema + ")");
  }
  List<HCatFieldSchema> fieldSchemas = new ArrayList<HCatFieldSchema>(pigSchema.size());
  for (FieldSchema fSchema : pigSchema.getFields()) {
   try {
    HCatFieldSchema hcatFieldSchema = getColFromSchema(fSchema.alias, tableSchema);
    //if writing to a partitioned table, then pigSchema will have more columns than tableSchema
    //partition columns are not part of tableSchema... e.g. TestHCatStorer#testPartColsInData()
//        HCatUtil.assertNotNull(hcatFieldSchema, "Nothing matching '" + fSchema.alias + "' found " +
//                "in target table schema", LOG);
    fieldSchemas.add(getHCatFSFromPigFS(fSchema, hcatFieldSchema, pigSchema, tableSchema));
   } catch (HCatException he) {
    throw new FrontendException(he.getMessage(), PigHCatUtil.PIG_EXCEPTION_CODE, he);
   }
  }
  
  HCatSchema s = new HCatSchema(fieldSchemas);
  LOG.debug("convertPigSchemaToHCatSchema(computed)=(" + s + ")");
  return s;
 }

origin: apache/hive

 throw new PigException(he.getMessage(),
  PigHCatUtil.PIG_EXCEPTION_CODE, he);
 doSchemaValidations(pigSchema, hcatTblSchema);
} catch (HCatException he) {
 throw new FrontendException(he.getMessage(), PigHCatUtil.PIG_EXCEPTION_CODE, he);
origin: apache/hive

public void testRemoveAddField() throws HCatException {
 List<HCatFieldSchema> fieldSchemaList = new ArrayList<HCatFieldSchema>();
 fieldSchemaList.add(new HCatFieldSchema("memberID", HCatFieldSchema.Type.INT, "as a number"));
 HCatFieldSchema locationField = new HCatFieldSchema("location", HCatFieldSchema.Type.STRING, "there's Waldo");
 fieldSchemaList.add(locationField);
 HCatSchema schema = new HCatSchema(fieldSchemaList);
 schema.remove(locationField);
 Integer position = schema.getPosition(locationField.getName());
 assertTrue("position is not null after remove" , position == null);
 try {
  schema.append(locationField);
 }
 catch (HCatException ex) {
  assertFalse(ex.getMessage(), true);
 }
}
origin: apache/hive

public void testCannotAddFieldMoreThanOnce() throws HCatException {
 List<HCatFieldSchema> fieldSchemaList = new ArrayList<HCatFieldSchema>();
 fieldSchemaList.add(new HCatFieldSchema("name", HCatFieldSchema.Type.STRING, "What's your handle?"));
 fieldSchemaList.add(new HCatFieldSchema("age", HCatFieldSchema.Type.INT, "So very old"));
 HCatSchema schema = new HCatSchema(fieldSchemaList);
 assertTrue(schema.getFieldNames().contains("age"));
 assertEquals(2, schema.getFields().size());
 try {
  schema.append(new HCatFieldSchema("age", HCatFieldSchema.Type.INT, "So very old"));
  fail("Was able to append field schema with same name");
 } catch (HCatException he) {
  assertTrue(he.getMessage().contains("Attempt to append HCatFieldSchema with already existing name: age."));
 }
 assertTrue(schema.getFieldNames().contains("age"));
 assertEquals(2, schema.getFields().size());
 // Should also not be able to add fields of different types with same name
 try {
  schema.append(new HCatFieldSchema("age", HCatFieldSchema.Type.STRING, "Maybe spelled out?"));
  fail("Was able to append field schema with same name");
 } catch (HCatException he) {
  assertTrue(he.getMessage().contains("Attempt to append HCatFieldSchema with already existing name: age."));
 }
 assertTrue(schema.getFieldNames().contains("age"));
 assertEquals(2, schema.getFields().size());
}
origin: apache/hive

@Test
public void testRenameTable() throws Exception {
 HCatClient client = HCatClient.create(new Configuration(hcatConf));
 String tableName = "temptable";
 String newName = "mytable";
 client.dropTable(null, tableName, true);
 client.dropTable(null, newName, true);
 ArrayList<HCatFieldSchema> cols = new ArrayList<HCatFieldSchema>();
 cols.add(new HCatFieldSchema("id", Type.INT, "id columns"));
 cols.add(new HCatFieldSchema("value", Type.STRING, "id columns"));
 HCatCreateTableDesc tableDesc = HCatCreateTableDesc
  .create(null, tableName, cols).fileFormat("rcfile").build();
 client.createTable(tableDesc);
 client.renameTable(null, tableName, newName);
 try {
  client.getTable(null, tableName);
 } catch (HCatException exp) {
  assertTrue("Unexpected exception message: " + exp.getMessage(),
    exp.getMessage().contains("NoSuchObjectException while fetching table"));
 }
 HCatTable newTable = client.getTable(null, newName);
 assertTrue(newTable != null);
 assertTrue(newTable.getTableName().equals(newName));
 client.close();
}
origin: apache/hive

 fail("Expected exception");
} catch (HCatException e) {
 assertTrue(e.getMessage().contains(
  "AlreadyExistsException while creating table."));
origin: com.github.hyukjinkwon.hcatalog/hive-hcatalog-core

@Override
public String toString() {
 return getMessage();
}
origin: org.spark-project.hive.hcatalog/hive-hcatalog-core

@Override
public String toString() {
 return getMessage();
}
origin: com.facebook.presto.hive/hive-apache

@Override
public String toString() {
 return getMessage();
}
origin: org.apache.hive.hcatalog/hive-hcatalog-core

@Override
public String toString() {
 return getMessage();
}
origin: org.apache.hive.hcatalog/hive-hcatalog-pig-adapter

 /** Constructs HCatSchema from pigSchema. Passed tableSchema is the existing
  * schema of the table in metastore.
  */
 protected HCatSchema convertPigSchemaToHCatSchema(Schema pigSchema, HCatSchema tableSchema) throws FrontendException {
  if(LOG.isDebugEnabled()) {
   LOG.debug("convertPigSchemaToHCatSchema(pigSchema,tblSchema)=(" + pigSchema + "," + tableSchema + ")");
  }
  List<HCatFieldSchema> fieldSchemas = new ArrayList<HCatFieldSchema>(pigSchema.size());
  for (FieldSchema fSchema : pigSchema.getFields()) {
   try {
    HCatFieldSchema hcatFieldSchema = getColFromSchema(fSchema.alias, tableSchema);
    //if writing to a partitioned table, then pigSchema will have more columns than tableSchema
    //partition columns are not part of tableSchema... e.g. TestHCatStorer#testPartColsInData()
//        HCatUtil.assertNotNull(hcatFieldSchema, "Nothing matching '" + fSchema.alias + "' found " +
//                "in target table schema", LOG);
    fieldSchemas.add(getHCatFSFromPigFS(fSchema, hcatFieldSchema, pigSchema, tableSchema));
   } catch (HCatException he) {
    throw new FrontendException(he.getMessage(), PigHCatUtil.PIG_EXCEPTION_CODE, he);
   }
  }
  
  HCatSchema s = new HCatSchema(fieldSchemas);
  LOG.debug("convertPigSchemaToHCatSchema(computed)=(" + s + ")");
  return s;
 }

origin: com.github.hyukjinkwon.hcatalog/hive-hcatalog-pig-adapter

 /** Constructs HCatSchema from pigSchema. Passed tableSchema is the existing
  * schema of the table in metastore.
  */
 protected HCatSchema convertPigSchemaToHCatSchema(Schema pigSchema, HCatSchema tableSchema) throws FrontendException {
  if(LOG.isDebugEnabled()) {
   LOG.debug("convertPigSchemaToHCatSchema(pigSchema,tblSchema)=(" + pigSchema + "," + tableSchema + ")");
  }
  List<HCatFieldSchema> fieldSchemas = new ArrayList<HCatFieldSchema>(pigSchema.size());
  for (FieldSchema fSchema : pigSchema.getFields()) {
   try {
    HCatFieldSchema hcatFieldSchema = getColFromSchema(fSchema.alias, tableSchema);
    //if writing to a partitioned table, then pigSchema will have more columns than tableSchema
    //partition columns are not part of tableSchema... e.g. TestHCatStorer#testPartColsInData()
//        HCatUtil.assertNotNull(hcatFieldSchema, "Nothing matching '" + fSchema.alias + "' found " +
//                "in target table schema", LOG);
    fieldSchemas.add(getHCatFSFromPigFS(fSchema, hcatFieldSchema, pigSchema, tableSchema));
   } catch (HCatException he) {
    throw new FrontendException(he.getMessage(), PigHCatUtil.PIG_EXCEPTION_CODE, he);
   }
  }
  
  HCatSchema s = new HCatSchema(fieldSchemas);
  LOG.debug("convertPigSchemaToHCatSchema(computed)=(" + s + ")");
  return s;
 }

origin: org.apache.hive.hcatalog/hive-hcatalog-pig-adapter

 throw new PigException(he.getMessage(),
  PigHCatUtil.PIG_EXCEPTION_CODE, he);
 doSchemaValidations(pigSchema, hcatTblSchema);
} catch (HCatException he) {
 throw new FrontendException(he.getMessage(), PigHCatUtil.PIG_EXCEPTION_CODE, he);
origin: com.github.hyukjinkwon.hcatalog/hive-hcatalog-pig-adapter

 throw new PigException(he.getMessage(),
  PigHCatUtil.PIG_EXCEPTION_CODE, he);
 doSchemaValidations(pigSchema, hcatTblSchema);
} catch (HCatException he) {
 throw new FrontendException(he.getMessage(), PigHCatUtil.PIG_EXCEPTION_CODE, he);
org.apache.hive.hcatalog.commonHCatExceptiongetMessage

Popular methods of HCatException

  • <init>
    Instantiates a new hcat exception.
  • buildErrorMessage
    Builds the error message string. The error type message is appended with the extra message. If appen
  • getErrorType
    Gets the error type.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Table (org.hibernate.mapping)
    A relational table
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now