org.apache.hadoop.hive.ql.metadata.Table.isImmutable()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(85)

本文整理了Java中org.apache.hadoop.hive.ql.metadata.Table.isImmutable()方法的一些代码示例,展示了Table.isImmutable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.isImmutable()方法的具体详情如下:
包路径:org.apache.hadoop.hive.ql.metadata.Table
类名称:Table
方法名:isImmutable

Table.isImmutable介绍

暂无

代码示例

代码示例来源:origin: apache/hive

private void checkImmutableTable(QB qb, Table dest_tab, Path dest_path, boolean isPart)
  throws SemanticException {
 // If the query here is an INSERT_INTO and the target is an immutable table,
 // verify that our destination is empty before proceeding
 if (!dest_tab.isImmutable() || !qb.getParseInfo().isInsertIntoTable(
   dest_tab.getDbName(), dest_tab.getTableName())) {
  return;
 }
 try {
  FileSystem fs = dest_path.getFileSystem(conf);
  if (! org.apache.hadoop.hive.metastore.utils.FileUtils.isDirEmpty(fs,dest_path)){
   LOG.warn("Attempted write into an immutable table : "
     + dest_tab.getTableName() + " : " + dest_path);
   throw new SemanticException(
     ErrorMsg.INSERT_INTO_IMMUTABLE_TABLE.getMsg(dest_tab.getTableName()));
  }
 } catch (IOException ioe) {
  LOG.warn("Error while trying to determine if immutable table "
    + (isPart ? "partition " : "") + "has any data : "  + dest_tab.getTableName()
    + " : " + dest_path);
  throw new SemanticException(ErrorMsg.INSERT_INTO_IMMUTABLE_TABLE.getMsg(ioe.getMessage()));
 }
}

代码示例来源:origin: apache/hive

moveTaskOutputs(fs, src, src, tblPath, false, table.isImmutable());
if (!src.equals(tblPath)) {
 fs.delete(src, true);
  Path src = new Path(jobInfo.getLocation());
  Path dest = new Path(p.getSd().getLocation());
  moveTaskOutputs(fs, src, src, dest, true, table.isImmutable());
  moveTaskOutputs(fs,src,src,dest,false,table.isImmutable());
  if (!src.equals(dest)){
   if (src.toString().matches(".*" + Path.SEPARATOR + SCRATCH_DIR_NAME + "\\d\\.?\\d+.*")){
   Partition existingP = client.getPartition(p.getDbName(),p.getTableName(),p.getValues());
   if (existingP != null){
    if (table.isImmutable()){
     throw new HCatException(ErrorType.ERROR_DUPLICATE_PARTITION,
       "Attempted duplicate partition publish on to immutable table");

代码示例来源:origin: apache/hive

if (!table.isImmutable()){
 return;

代码示例来源:origin: apache/drill

if (dest_tab.isImmutable() &&
  qb.getParseInfo().isInsertIntoTable(dest_tab.getDbName(),dest_tab.getTableName())){
 try {
if (dest_tab.isImmutable() &&
  qb.getParseInfo().isInsertIntoTable(dest_tab.getDbName(),dest_tab.getTableName())){
 try {

代码示例来源:origin: com.github.hyukjinkwon.hcatalog/hive-hcatalog-core

if (!table.isImmutable()){
 return;

代码示例来源:origin: org.apache.hive.hcatalog/hive-hcatalog-core

moveTaskOutputs(fs, src, src, tblPath, false, table.isImmutable());
if (!src.equals(tblPath)) {
 fs.delete(src, true);
  Path src = new Path(jobInfo.getLocation());
  Path dest = new Path(p.getSd().getLocation());
  moveTaskOutputs(fs, src, src, dest, true, table.isImmutable());
  moveTaskOutputs(fs,src,src,dest,false,table.isImmutable());
  if (!src.equals(dest)){
   if (src.toString().matches(".*" + Path.SEPARATOR + SCRATCH_DIR_NAME + "\\d\\.?\\d+.*")){
   Partition existingP = client.getPartition(p.getDbName(),p.getTableName(),p.getValues());
   if (existingP != null){
    if (table.isImmutable()){
     throw new HCatException(ErrorType.ERROR_DUPLICATE_PARTITION,
       "Attempted duplicate partition publish on to immutable table");

代码示例来源:origin: org.spark-project.hive.hcatalog/hive-hcatalog-core

moveTaskOutputs(fs, src, src, tblPath, false, table.isImmutable());
if (!src.equals(tblPath)){
 fs.delete(src, true);
   Path src = new Path(jobInfo.getLocation());
   Path dest = new Path(p.getSd().getLocation());
   moveTaskOutputs(fs, src, src, dest, true, table.isImmutable());
   moveTaskOutputs(fs,src,src,dest,false,table.isImmutable());
   if (!src.equals(dest)){
    fs.delete(src, true);
    Partition existingP = client.getPartition(p.getDbName(),p.getTableName(),p.getValues());
    if (existingP != null){
     if (table.isImmutable()){
      throw new HCatException(ErrorType.ERROR_DUPLICATE_PARTITION,
        "Attempted duplicate partition publish on to immutable table");

代码示例来源:origin: com.facebook.presto.hive/hive-apache

if (!table.isImmutable()){
 return;

代码示例来源:origin: org.spark-project.hive.hcatalog/hive-hcatalog-core

if (!table.isImmutable()){
 return;

代码示例来源:origin: org.apache.hive.hcatalog/hive-hcatalog-core

if (!table.isImmutable()){
 return;

代码示例来源:origin: com.github.hyukjinkwon.hcatalog/hive-hcatalog-core

moveTaskOutputs(fs, src, src, tblPath, false, table.isImmutable());
if (!src.equals(tblPath)){
 fs.delete(src, true);
   Path src = new Path(jobInfo.getLocation());
   Path dest = new Path(p.getSd().getLocation());
   moveTaskOutputs(fs, src, src, dest, true, table.isImmutable());
   moveTaskOutputs(fs,src,src,dest,false,table.isImmutable());
   if (!src.equals(dest)){
    fs.delete(src, true);
    Partition existingP = client.getPartition(p.getDbName(),p.getTableName(),p.getValues());
    if (existingP != null){
     if (table.isImmutable()){
      throw new HCatException(ErrorType.ERROR_DUPLICATE_PARTITION,
        "Attempted duplicate partition publish on to immutable table");

代码示例来源:origin: com.facebook.presto.hive/hive-apache

moveTaskOutputs(fs, src, src, tblPath, false, table.isImmutable());
if (!src.equals(tblPath)){
 fs.delete(src, true);
   Path src = new Path(jobInfo.getLocation());
   Path dest = new Path(p.getSd().getLocation());
   moveTaskOutputs(fs, src, src, dest, true, table.isImmutable());
   moveTaskOutputs(fs,src,src,dest,false,table.isImmutable());
   if (!src.equals(dest)){
    fs.delete(src, true);
    Partition existingP = client.getPartition(p.getDbName(),p.getTableName(),p.getValues());
    if (existingP != null){
     if (table.isImmutable()){
      throw new HCatException(ErrorType.ERROR_DUPLICATE_PARTITION,
        "Attempted duplicate partition publish on to immutable table");

代码示例来源:origin: com.facebook.presto.hive/hive-apache

if (dest_tab.isImmutable() &&
  qb.getParseInfo().isInsertIntoTable(dest_tab.getDbName(),dest_tab.getTableName())){
 try {
if (dest_tab.isImmutable() &&
  qb.getParseInfo().isInsertIntoTable(dest_tab.getDbName(),dest_tab.getTableName())){
 qb.getParseInfo().isInsertToTable();

相关文章

微信公众号

最新文章

更多

Table类方法