org.apache.hadoop.hive.ql.plan.api.Query.write()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(95)

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

Query.write介绍

暂无

代码示例

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

private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
 try {
  write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
 } catch (org.apache.thrift.TException te) {
  throw new java.io.IOException(te);
 }
}

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

private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
 try {
  write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
 } catch (org.apache.thrift.TException te) {
  throw new java.io.IOException(te);
 }
}

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

public void write(org.apache.thrift.protocol.TProtocol oprot, QueryPlan struct) throws org.apache.thrift.TException {
 struct.validate();
 oprot.writeStructBegin(STRUCT_DESC);
 if (struct.queries != null) {
  oprot.writeFieldBegin(QUERIES_FIELD_DESC);
  {
   oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.queries.size()));
   for (Query _iter131 : struct.queries)
   {
    _iter131.write(oprot);
   }
   oprot.writeListEnd();
  }
  oprot.writeFieldEnd();
 }
 oprot.writeFieldBegin(DONE_FIELD_DESC);
 oprot.writeBool(struct.done);
 oprot.writeFieldEnd();
 oprot.writeFieldBegin(STARTED_FIELD_DESC);
 oprot.writeBool(struct.started);
 oprot.writeFieldEnd();
 oprot.writeFieldStop();
 oprot.writeStructEnd();
}

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

public void write(org.apache.thrift.protocol.TProtocol oprot, QueryPlan struct) throws org.apache.thrift.TException {
 struct.validate();
 oprot.writeStructBegin(STRUCT_DESC);
 if (struct.queries != null) {
  oprot.writeFieldBegin(QUERIES_FIELD_DESC);
  {
   oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.queries.size()));
   for (Query _iter131 : struct.queries)
   {
    _iter131.write(oprot);
   }
   oprot.writeListEnd();
  }
  oprot.writeFieldEnd();
 }
 oprot.writeFieldBegin(DONE_FIELD_DESC);
 oprot.writeBool(struct.done);
 oprot.writeFieldEnd();
 oprot.writeFieldBegin(STARTED_FIELD_DESC);
 oprot.writeBool(struct.started);
 oprot.writeFieldEnd();
 oprot.writeFieldStop();
 oprot.writeStructEnd();
}

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

public String toBinaryString() throws IOException {
 org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan();
 TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5);
 TBinaryProtocol oprot = new TBinaryProtocol(tmb);
 try {
  q.write(oprot);
 } catch (TException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  return q.toString();
 }
 byte[] buf = new byte[tmb.length()];
 tmb.read(buf, 0, tmb.length());
 return new String(buf);
 // return getQueryPlan().toString();
}

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

public String toBinaryString() throws IOException {
 org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan();
 TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5);
 TBinaryProtocol oprot = new TBinaryProtocol(tmb);
 try {
  q.write(oprot);
 } catch (TException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  return q.toString();
 }
 byte[] buf = new byte[tmb.length()];
 tmb.read(buf, 0, tmb.length());
 return new String(buf);
 // return getQueryPlan().toString();
}

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

public String toThriftJSONString() throws IOException {
 org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan();
 TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5);
 TJSONProtocol oprot = new TJSONProtocol(tmb);
 try {
  q.write(oprot);
 } catch (TException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  return q.toString();
 }
 return tmb.toString("UTF-8");
}

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

@Override
public void write(org.apache.thrift.protocol.TProtocol prot, QueryPlan struct) throws org.apache.thrift.TException {
 TTupleProtocol oprot = (TTupleProtocol) prot;
 BitSet optionals = new BitSet();
 if (struct.isSetQueries()) {
  optionals.set(0);
 }
 if (struct.isSetDone()) {
  optionals.set(1);
 }
 if (struct.isSetStarted()) {
  optionals.set(2);
 }
 oprot.writeBitSet(optionals, 3);
 if (struct.isSetQueries()) {
  {
   oprot.writeI32(struct.queries.size());
   for (Query _iter132 : struct.queries)
   {
    _iter132.write(oprot);
   }
  }
 }
 if (struct.isSetDone()) {
  oprot.writeBool(struct.done);
 }
 if (struct.isSetStarted()) {
  oprot.writeBool(struct.started);
 }
}

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

public String toThriftJSONString() throws IOException {
 org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan();
 TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5);
 TJSONProtocol oprot = new TJSONProtocol(tmb);
 try {
  q.write(oprot);
 } catch (TException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  return q.toString();
 }
 return tmb.toString("UTF-8");
}

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

@Override
public void write(org.apache.thrift.protocol.TProtocol prot, QueryPlan struct) throws org.apache.thrift.TException {
 TTupleProtocol oprot = (TTupleProtocol) prot;
 BitSet optionals = new BitSet();
 if (struct.isSetQueries()) {
  optionals.set(0);
 }
 if (struct.isSetDone()) {
  optionals.set(1);
 }
 if (struct.isSetStarted()) {
  optionals.set(2);
 }
 oprot.writeBitSet(optionals, 3);
 if (struct.isSetQueries()) {
  {
   oprot.writeI32(struct.queries.size());
   for (Query _iter132 : struct.queries)
   {
    _iter132.write(oprot);
   }
  }
 }
 if (struct.isSetDone()) {
  oprot.writeBool(struct.done);
 }
 if (struct.isSetStarted()) {
  oprot.writeBool(struct.started);
 }
}

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

private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
 try {
  write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
 } catch (org.apache.thrift.TException te) {
  throw new java.io.IOException(te);
 }
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

public void write(TProtocol oprot) throws TException {
 validate();
 oprot.writeStructBegin(STRUCT_DESC);
 if (this.queries != null) {
  oprot.writeFieldBegin(QUERIES_FIELD_DESC);
  {
   oprot.writeListBegin(new TList(TType.STRUCT, this.queries.size()));
   for (Query _iter67 : this.queries)
   {
    _iter67.write(oprot);
   }
   oprot.writeListEnd();
  }
  oprot.writeFieldEnd();
 }
 oprot.writeFieldBegin(DONE_FIELD_DESC);
 oprot.writeBool(this.done);
 oprot.writeFieldEnd();
 oprot.writeFieldBegin(STARTED_FIELD_DESC);
 oprot.writeBool(this.started);
 oprot.writeFieldEnd();
 oprot.writeFieldStop();
 oprot.writeStructEnd();
}

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

public void write(org.apache.thrift.protocol.TProtocol oprot, QueryPlan struct) throws org.apache.thrift.TException {
 struct.validate();
 oprot.writeStructBegin(STRUCT_DESC);
 if (struct.queries != null) {
  oprot.writeFieldBegin(QUERIES_FIELD_DESC);
  {
   oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.queries.size()));
   for (Query _iter131 : struct.queries)
   {
    _iter131.write(oprot);
   }
   oprot.writeListEnd();
  }
  oprot.writeFieldEnd();
 }
 oprot.writeFieldBegin(DONE_FIELD_DESC);
 oprot.writeBool(struct.done);
 oprot.writeFieldEnd();
 oprot.writeFieldBegin(STARTED_FIELD_DESC);
 oprot.writeBool(struct.started);
 oprot.writeFieldEnd();
 oprot.writeFieldStop();
 oprot.writeStructEnd();
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

public String toBinaryString() throws IOException {
 org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan();
 TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5);
 TBinaryProtocol oprot = new TBinaryProtocol(tmb);
 try {
  q.write(oprot);
 } catch (TException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  return q.toString();
 }
 byte[] buf = new byte[tmb.length()];
 tmb.read(buf, 0, tmb.length());
 return new String(buf);
 // return getQueryPlan().toString();
}

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

public String toBinaryString() throws IOException {
 org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan();
 TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5);
 TBinaryProtocol oprot = new TBinaryProtocol(tmb);
 try {
  q.write(oprot);
 } catch (TException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  return q.toString();
 }
 byte[] buf = new byte[tmb.length()];
 tmb.read(buf, 0, tmb.length());
 return new String(buf);
 // return getQueryPlan().toString();
}

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

public String toThriftJSONString() throws IOException {
 org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan();
 TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5);
 TJSONProtocol oprot = new TJSONProtocol(tmb);
 try {
  q.write(oprot);
 } catch (TException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  return q.toString();
 }
 return tmb.toString("UTF-8");
}

代码示例来源:origin: org.apache.hadoop.hive/hive-exec

public String toThriftJSONString() throws IOException {
 org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan();
 TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5);
 TJSONProtocol oprot = new TJSONProtocol(tmb);
 try {
  q.write(oprot);
 } catch (TException e) {
  // TODO Auto-generated catch block
  e.printStackTrace();
  return q.toString();
 }
 return tmb.toString("UTF-8");
}

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

@Override
public void write(org.apache.thrift.protocol.TProtocol prot, QueryPlan struct) throws org.apache.thrift.TException {
 TTupleProtocol oprot = (TTupleProtocol) prot;
 BitSet optionals = new BitSet();
 if (struct.isSetQueries()) {
  optionals.set(0);
 }
 if (struct.isSetDone()) {
  optionals.set(1);
 }
 if (struct.isSetStarted()) {
  optionals.set(2);
 }
 oprot.writeBitSet(optionals, 3);
 if (struct.isSetQueries()) {
  {
   oprot.writeI32(struct.queries.size());
   for (Query _iter132 : struct.queries)
   {
    _iter132.write(oprot);
   }
  }
 }
 if (struct.isSetDone()) {
  oprot.writeBool(struct.done);
 }
 if (struct.isSetStarted()) {
  oprot.writeBool(struct.started);
 }
}

相关文章