/**
 * Autogenerated by Thrift Compiler (0.9.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.cloudera.impala.thrift;

import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TQueryOptions implements org.apache.thrift.TBase<TQueryOptions, TQueryOptions._Fields>, java.io.Serializable, Cloneable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TQueryOptions");

  private static final org.apache.thrift.protocol.TField ABORT_ON_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("abort_on_error", org.apache.thrift.protocol.TType.BOOL, (short)1);
  private static final org.apache.thrift.protocol.TField MAX_ERRORS_FIELD_DESC = new org.apache.thrift.protocol.TField("max_errors", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField DISABLE_CODEGEN_FIELD_DESC = new org.apache.thrift.protocol.TField("disable_codegen", org.apache.thrift.protocol.TType.BOOL, (short)3);
  private static final org.apache.thrift.protocol.TField BATCH_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("batch_size", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField NUM_NODES_FIELD_DESC = new org.apache.thrift.protocol.TField("num_nodes", org.apache.thrift.protocol.TType.I32, (short)5);
  private static final org.apache.thrift.protocol.TField MAX_SCAN_RANGE_LENGTH_FIELD_DESC = new org.apache.thrift.protocol.TField("max_scan_range_length", org.apache.thrift.protocol.TType.I64, (short)6);
  private static final org.apache.thrift.protocol.TField NUM_SCANNER_THREADS_FIELD_DESC = new org.apache.thrift.protocol.TField("num_scanner_threads", org.apache.thrift.protocol.TType.I32, (short)7);
  private static final org.apache.thrift.protocol.TField MAX_IO_BUFFERS_FIELD_DESC = new org.apache.thrift.protocol.TField("max_io_buffers", org.apache.thrift.protocol.TType.I32, (short)8);
  private static final org.apache.thrift.protocol.TField ALLOW_UNSUPPORTED_FORMATS_FIELD_DESC = new org.apache.thrift.protocol.TField("allow_unsupported_formats", org.apache.thrift.protocol.TType.BOOL, (short)9);
  private static final org.apache.thrift.protocol.TField DEFAULT_ORDER_BY_LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("default_order_by_limit", org.apache.thrift.protocol.TType.I64, (short)10);
  private static final org.apache.thrift.protocol.TField DEBUG_ACTION_FIELD_DESC = new org.apache.thrift.protocol.TField("debug_action", org.apache.thrift.protocol.TType.STRING, (short)11);
  private static final org.apache.thrift.protocol.TField MEM_LIMIT_FIELD_DESC = new org.apache.thrift.protocol.TField("mem_limit", org.apache.thrift.protocol.TType.I64, (short)12);
  private static final org.apache.thrift.protocol.TField ABORT_ON_DEFAULT_LIMIT_EXCEEDED_FIELD_DESC = new org.apache.thrift.protocol.TField("abort_on_default_limit_exceeded", org.apache.thrift.protocol.TType.BOOL, (short)13);
  private static final org.apache.thrift.protocol.TField COMPRESSION_CODEC_FIELD_DESC = new org.apache.thrift.protocol.TField("compression_codec", org.apache.thrift.protocol.TType.I32, (short)14);
  private static final org.apache.thrift.protocol.TField HBASE_CACHING_FIELD_DESC = new org.apache.thrift.protocol.TField("hbase_caching", org.apache.thrift.protocol.TType.I32, (short)15);
  private static final org.apache.thrift.protocol.TField HBASE_CACHE_BLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("hbase_cache_blocks", org.apache.thrift.protocol.TType.BOOL, (short)16);
  private static final org.apache.thrift.protocol.TField PARQUET_FILE_SIZE_FIELD_DESC = new org.apache.thrift.protocol.TField("parquet_file_size", org.apache.thrift.protocol.TType.I64, (short)17);
  private static final org.apache.thrift.protocol.TField EXPLAIN_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("explain_level", org.apache.thrift.protocol.TType.I32, (short)18);
  private static final org.apache.thrift.protocol.TField SYNC_DDL_FIELD_DESC = new org.apache.thrift.protocol.TField("sync_ddl", org.apache.thrift.protocol.TType.BOOL, (short)19);
  private static final org.apache.thrift.protocol.TField REQUEST_POOL_FIELD_DESC = new org.apache.thrift.protocol.TField("request_pool", org.apache.thrift.protocol.TType.STRING, (short)20);
  private static final org.apache.thrift.protocol.TField V_CPU_CORES_FIELD_DESC = new org.apache.thrift.protocol.TField("v_cpu_cores", org.apache.thrift.protocol.TType.I16, (short)21);
  private static final org.apache.thrift.protocol.TField RESERVATION_REQUEST_TIMEOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("reservation_request_timeout", org.apache.thrift.protocol.TType.I64, (short)22);
  private static final org.apache.thrift.protocol.TField DISABLE_CACHED_READS_FIELD_DESC = new org.apache.thrift.protocol.TField("disable_cached_reads", org.apache.thrift.protocol.TType.BOOL, (short)23);
  private static final org.apache.thrift.protocol.TField DISABLE_OUTERMOST_TOPN_FIELD_DESC = new org.apache.thrift.protocol.TField("disable_outermost_topn", org.apache.thrift.protocol.TType.BOOL, (short)24);
  private static final org.apache.thrift.protocol.TField RM_INITIAL_MEM_FIELD_DESC = new org.apache.thrift.protocol.TField("rm_initial_mem", org.apache.thrift.protocol.TType.I64, (short)25);
  private static final org.apache.thrift.protocol.TField QUERY_TIMEOUT_S_FIELD_DESC = new org.apache.thrift.protocol.TField("query_timeout_s", org.apache.thrift.protocol.TType.I32, (short)26);
  private static final org.apache.thrift.protocol.TField MAX_BLOCK_MGR_MEMORY_FIELD_DESC = new org.apache.thrift.protocol.TField("max_block_mgr_memory", org.apache.thrift.protocol.TType.I64, (short)27);
  private static final org.apache.thrift.protocol.TField APPX_COUNT_DISTINCT_FIELD_DESC = new org.apache.thrift.protocol.TField("appx_count_distinct", org.apache.thrift.protocol.TType.BOOL, (short)28);
  private static final org.apache.thrift.protocol.TField DISABLE_UNSAFE_SPILLS_FIELD_DESC = new org.apache.thrift.protocol.TField("disable_unsafe_spills", org.apache.thrift.protocol.TType.BOOL, (short)29);
  private static final org.apache.thrift.protocol.TField SEQ_COMPRESSION_MODE_FIELD_DESC = new org.apache.thrift.protocol.TField("seq_compression_mode", org.apache.thrift.protocol.TType.I32, (short)30);
  private static final org.apache.thrift.protocol.TField EXEC_SINGLE_NODE_ROWS_THRESHOLD_FIELD_DESC = new org.apache.thrift.protocol.TField("exec_single_node_rows_threshold", org.apache.thrift.protocol.TType.I32, (short)31);

  private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new TQueryOptionsStandardSchemeFactory());
    schemes.put(TupleScheme.class, new TQueryOptionsTupleSchemeFactory());
  }

  public boolean abort_on_error; // optional
  public int max_errors; // optional
  public boolean disable_codegen; // optional
  public int batch_size; // optional
  public int num_nodes; // optional
  public long max_scan_range_length; // optional
  public int num_scanner_threads; // optional
  public int max_io_buffers; // optional
  public boolean allow_unsupported_formats; // optional
  public long default_order_by_limit; // optional
  public String debug_action; // optional
  public long mem_limit; // optional
  public boolean abort_on_default_limit_exceeded; // optional
  /**
   * 
   * @see com.cloudera.impala.thrift.THdfsCompression
   */
  public com.cloudera.impala.thrift.THdfsCompression compression_codec; // optional
  public int hbase_caching; // optional
  public boolean hbase_cache_blocks; // optional
  public long parquet_file_size; // optional
  /**
   * 
   * @see com.cloudera.impala.thrift.TExplainLevel
   */
  public com.cloudera.impala.thrift.TExplainLevel explain_level; // optional
  public boolean sync_ddl; // optional
  public String request_pool; // optional
  public short v_cpu_cores; // optional
  public long reservation_request_timeout; // optional
  public boolean disable_cached_reads; // optional
  public boolean disable_outermost_topn; // optional
  public long rm_initial_mem; // optional
  public int query_timeout_s; // optional
  public long max_block_mgr_memory; // optional
  public boolean appx_count_distinct; // optional
  public boolean disable_unsafe_spills; // optional
  /**
   * 
   * @see com.cloudera.impala.thrift.THdfsSeqCompressionMode
   */
  public com.cloudera.impala.thrift.THdfsSeqCompressionMode seq_compression_mode; // optional
  public int exec_single_node_rows_threshold; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    ABORT_ON_ERROR((short)1, "abort_on_error"),
    MAX_ERRORS((short)2, "max_errors"),
    DISABLE_CODEGEN((short)3, "disable_codegen"),
    BATCH_SIZE((short)4, "batch_size"),
    NUM_NODES((short)5, "num_nodes"),
    MAX_SCAN_RANGE_LENGTH((short)6, "max_scan_range_length"),
    NUM_SCANNER_THREADS((short)7, "num_scanner_threads"),
    MAX_IO_BUFFERS((short)8, "max_io_buffers"),
    ALLOW_UNSUPPORTED_FORMATS((short)9, "allow_unsupported_formats"),
    DEFAULT_ORDER_BY_LIMIT((short)10, "default_order_by_limit"),
    DEBUG_ACTION((short)11, "debug_action"),
    MEM_LIMIT((short)12, "mem_limit"),
    ABORT_ON_DEFAULT_LIMIT_EXCEEDED((short)13, "abort_on_default_limit_exceeded"),
    /**
     * 
     * @see com.cloudera.impala.thrift.THdfsCompression
     */
    COMPRESSION_CODEC((short)14, "compression_codec"),
    HBASE_CACHING((short)15, "hbase_caching"),
    HBASE_CACHE_BLOCKS((short)16, "hbase_cache_blocks"),
    PARQUET_FILE_SIZE((short)17, "parquet_file_size"),
    /**
     * 
     * @see com.cloudera.impala.thrift.TExplainLevel
     */
    EXPLAIN_LEVEL((short)18, "explain_level"),
    SYNC_DDL((short)19, "sync_ddl"),
    REQUEST_POOL((short)20, "request_pool"),
    V_CPU_CORES((short)21, "v_cpu_cores"),
    RESERVATION_REQUEST_TIMEOUT((short)22, "reservation_request_timeout"),
    DISABLE_CACHED_READS((short)23, "disable_cached_reads"),
    DISABLE_OUTERMOST_TOPN((short)24, "disable_outermost_topn"),
    RM_INITIAL_MEM((short)25, "rm_initial_mem"),
    QUERY_TIMEOUT_S((short)26, "query_timeout_s"),
    MAX_BLOCK_MGR_MEMORY((short)27, "max_block_mgr_memory"),
    APPX_COUNT_DISTINCT((short)28, "appx_count_distinct"),
    DISABLE_UNSAFE_SPILLS((short)29, "disable_unsafe_spills"),
    /**
     * 
     * @see com.cloudera.impala.thrift.THdfsSeqCompressionMode
     */
    SEQ_COMPRESSION_MODE((short)30, "seq_compression_mode"),
    EXEC_SINGLE_NODE_ROWS_THRESHOLD((short)31, "exec_single_node_rows_threshold");

    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // ABORT_ON_ERROR
          return ABORT_ON_ERROR;
        case 2: // MAX_ERRORS
          return MAX_ERRORS;
        case 3: // DISABLE_CODEGEN
          return DISABLE_CODEGEN;
        case 4: // BATCH_SIZE
          return BATCH_SIZE;
        case 5: // NUM_NODES
          return NUM_NODES;
        case 6: // MAX_SCAN_RANGE_LENGTH
          return MAX_SCAN_RANGE_LENGTH;
        case 7: // NUM_SCANNER_THREADS
          return NUM_SCANNER_THREADS;
        case 8: // MAX_IO_BUFFERS
          return MAX_IO_BUFFERS;
        case 9: // ALLOW_UNSUPPORTED_FORMATS
          return ALLOW_UNSUPPORTED_FORMATS;
        case 10: // DEFAULT_ORDER_BY_LIMIT
          return DEFAULT_ORDER_BY_LIMIT;
        case 11: // DEBUG_ACTION
          return DEBUG_ACTION;
        case 12: // MEM_LIMIT
          return MEM_LIMIT;
        case 13: // ABORT_ON_DEFAULT_LIMIT_EXCEEDED
          return ABORT_ON_DEFAULT_LIMIT_EXCEEDED;
        case 14: // COMPRESSION_CODEC
          return COMPRESSION_CODEC;
        case 15: // HBASE_CACHING
          return HBASE_CACHING;
        case 16: // HBASE_CACHE_BLOCKS
          return HBASE_CACHE_BLOCKS;
        case 17: // PARQUET_FILE_SIZE
          return PARQUET_FILE_SIZE;
        case 18: // EXPLAIN_LEVEL
          return EXPLAIN_LEVEL;
        case 19: // SYNC_DDL
          return SYNC_DDL;
        case 20: // REQUEST_POOL
          return REQUEST_POOL;
        case 21: // V_CPU_CORES
          return V_CPU_CORES;
        case 22: // RESERVATION_REQUEST_TIMEOUT
          return RESERVATION_REQUEST_TIMEOUT;
        case 23: // DISABLE_CACHED_READS
          return DISABLE_CACHED_READS;
        case 24: // DISABLE_OUTERMOST_TOPN
          return DISABLE_OUTERMOST_TOPN;
        case 25: // RM_INITIAL_MEM
          return RM_INITIAL_MEM;
        case 26: // QUERY_TIMEOUT_S
          return QUERY_TIMEOUT_S;
        case 27: // MAX_BLOCK_MGR_MEMORY
          return MAX_BLOCK_MGR_MEMORY;
        case 28: // APPX_COUNT_DISTINCT
          return APPX_COUNT_DISTINCT;
        case 29: // DISABLE_UNSAFE_SPILLS
          return DISABLE_UNSAFE_SPILLS;
        case 30: // SEQ_COMPRESSION_MODE
          return SEQ_COMPRESSION_MODE;
        case 31: // EXEC_SINGLE_NODE_ROWS_THRESHOLD
          return EXEC_SINGLE_NODE_ROWS_THRESHOLD;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __ABORT_ON_ERROR_ISSET_ID = 0;
  private static final int __MAX_ERRORS_ISSET_ID = 1;
  private static final int __DISABLE_CODEGEN_ISSET_ID = 2;
  private static final int __BATCH_SIZE_ISSET_ID = 3;
  private static final int __NUM_NODES_ISSET_ID = 4;
  private static final int __MAX_SCAN_RANGE_LENGTH_ISSET_ID = 5;
  private static final int __NUM_SCANNER_THREADS_ISSET_ID = 6;
  private static final int __MAX_IO_BUFFERS_ISSET_ID = 7;
  private static final int __ALLOW_UNSUPPORTED_FORMATS_ISSET_ID = 8;
  private static final int __DEFAULT_ORDER_BY_LIMIT_ISSET_ID = 9;
  private static final int __MEM_LIMIT_ISSET_ID = 10;
  private static final int __ABORT_ON_DEFAULT_LIMIT_EXCEEDED_ISSET_ID = 11;
  private static final int __HBASE_CACHING_ISSET_ID = 12;
  private static final int __HBASE_CACHE_BLOCKS_ISSET_ID = 13;
  private static final int __PARQUET_FILE_SIZE_ISSET_ID = 14;
  private static final int __SYNC_DDL_ISSET_ID = 15;
  private static final int __V_CPU_CORES_ISSET_ID = 16;
  private static final int __RESERVATION_REQUEST_TIMEOUT_ISSET_ID = 17;
  private static final int __DISABLE_CACHED_READS_ISSET_ID = 18;
  private static final int __DISABLE_OUTERMOST_TOPN_ISSET_ID = 19;
  private static final int __RM_INITIAL_MEM_ISSET_ID = 20;
  private static final int __QUERY_TIMEOUT_S_ISSET_ID = 21;
  private static final int __MAX_BLOCK_MGR_MEMORY_ISSET_ID = 22;
  private static final int __APPX_COUNT_DISTINCT_ISSET_ID = 23;
  private static final int __DISABLE_UNSAFE_SPILLS_ISSET_ID = 24;
  private static final int __EXEC_SINGLE_NODE_ROWS_THRESHOLD_ISSET_ID = 25;
  private int __isset_bitfield = 0;
  private _Fields optionals[] = {_Fields.ABORT_ON_ERROR,_Fields.MAX_ERRORS,_Fields.DISABLE_CODEGEN,_Fields.BATCH_SIZE,_Fields.NUM_NODES,_Fields.MAX_SCAN_RANGE_LENGTH,_Fields.NUM_SCANNER_THREADS,_Fields.MAX_IO_BUFFERS,_Fields.ALLOW_UNSUPPORTED_FORMATS,_Fields.DEFAULT_ORDER_BY_LIMIT,_Fields.DEBUG_ACTION,_Fields.MEM_LIMIT,_Fields.ABORT_ON_DEFAULT_LIMIT_EXCEEDED,_Fields.COMPRESSION_CODEC,_Fields.HBASE_CACHING,_Fields.HBASE_CACHE_BLOCKS,_Fields.PARQUET_FILE_SIZE,_Fields.EXPLAIN_LEVEL,_Fields.SYNC_DDL,_Fields.REQUEST_POOL,_Fields.V_CPU_CORES,_Fields.RESERVATION_REQUEST_TIMEOUT,_Fields.DISABLE_CACHED_READS,_Fields.DISABLE_OUTERMOST_TOPN,_Fields.RM_INITIAL_MEM,_Fields.QUERY_TIMEOUT_S,_Fields.MAX_BLOCK_MGR_MEMORY,_Fields.APPX_COUNT_DISTINCT,_Fields.DISABLE_UNSAFE_SPILLS,_Fields.SEQ_COMPRESSION_MODE,_Fields.EXEC_SINGLE_NODE_ROWS_THRESHOLD};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.ABORT_ON_ERROR, new org.apache.thrift.meta_data.FieldMetaData("abort_on_error", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.MAX_ERRORS, new org.apache.thrift.meta_data.FieldMetaData("max_errors", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.DISABLE_CODEGEN, new org.apache.thrift.meta_data.FieldMetaData("disable_codegen", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.BATCH_SIZE, new org.apache.thrift.meta_data.FieldMetaData("batch_size", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.NUM_NODES, new org.apache.thrift.meta_data.FieldMetaData("num_nodes", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.MAX_SCAN_RANGE_LENGTH, new org.apache.thrift.meta_data.FieldMetaData("max_scan_range_length", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.NUM_SCANNER_THREADS, new org.apache.thrift.meta_data.FieldMetaData("num_scanner_threads", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.MAX_IO_BUFFERS, new org.apache.thrift.meta_data.FieldMetaData("max_io_buffers", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.ALLOW_UNSUPPORTED_FORMATS, new org.apache.thrift.meta_data.FieldMetaData("allow_unsupported_formats", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.DEFAULT_ORDER_BY_LIMIT, new org.apache.thrift.meta_data.FieldMetaData("default_order_by_limit", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DEBUG_ACTION, new org.apache.thrift.meta_data.FieldMetaData("debug_action", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.MEM_LIMIT, new org.apache.thrift.meta_data.FieldMetaData("mem_limit", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.ABORT_ON_DEFAULT_LIMIT_EXCEEDED, new org.apache.thrift.meta_data.FieldMetaData("abort_on_default_limit_exceeded", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.COMPRESSION_CODEC, new org.apache.thrift.meta_data.FieldMetaData("compression_codec", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, com.cloudera.impala.thrift.THdfsCompression.class)));
    tmpMap.put(_Fields.HBASE_CACHING, new org.apache.thrift.meta_data.FieldMetaData("hbase_caching", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.HBASE_CACHE_BLOCKS, new org.apache.thrift.meta_data.FieldMetaData("hbase_cache_blocks", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.PARQUET_FILE_SIZE, new org.apache.thrift.meta_data.FieldMetaData("parquet_file_size", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.EXPLAIN_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("explain_level", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, com.cloudera.impala.thrift.TExplainLevel.class)));
    tmpMap.put(_Fields.SYNC_DDL, new org.apache.thrift.meta_data.FieldMetaData("sync_ddl", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.REQUEST_POOL, new org.apache.thrift.meta_data.FieldMetaData("request_pool", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.V_CPU_CORES, new org.apache.thrift.meta_data.FieldMetaData("v_cpu_cores", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
    tmpMap.put(_Fields.RESERVATION_REQUEST_TIMEOUT, new org.apache.thrift.meta_data.FieldMetaData("reservation_request_timeout", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.DISABLE_CACHED_READS, new org.apache.thrift.meta_data.FieldMetaData("disable_cached_reads", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.DISABLE_OUTERMOST_TOPN, new org.apache.thrift.meta_data.FieldMetaData("disable_outermost_topn", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.RM_INITIAL_MEM, new org.apache.thrift.meta_data.FieldMetaData("rm_initial_mem", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.QUERY_TIMEOUT_S, new org.apache.thrift.meta_data.FieldMetaData("query_timeout_s", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.MAX_BLOCK_MGR_MEMORY, new org.apache.thrift.meta_data.FieldMetaData("max_block_mgr_memory", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.APPX_COUNT_DISTINCT, new org.apache.thrift.meta_data.FieldMetaData("appx_count_distinct", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.DISABLE_UNSAFE_SPILLS, new org.apache.thrift.meta_data.FieldMetaData("disable_unsafe_spills", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
    tmpMap.put(_Fields.SEQ_COMPRESSION_MODE, new org.apache.thrift.meta_data.FieldMetaData("seq_compression_mode", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, com.cloudera.impala.thrift.THdfsSeqCompressionMode.class)));
    tmpMap.put(_Fields.EXEC_SINGLE_NODE_ROWS_THRESHOLD, new org.apache.thrift.meta_data.FieldMetaData("exec_single_node_rows_threshold", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TQueryOptions.class, metaDataMap);
  }

  public TQueryOptions() {
    this.abort_on_error = false;

    this.max_errors = 0;

    this.disable_codegen = false;

    this.batch_size = 0;

    this.num_nodes = 0;

    this.max_scan_range_length = 0L;

    this.num_scanner_threads = 0;

    this.max_io_buffers = 0;

    this.allow_unsupported_formats = false;

    this.default_order_by_limit = -1L;

    this.debug_action = "";

    this.mem_limit = 0L;

    this.abort_on_default_limit_exceeded = false;

    this.hbase_caching = 0;

    this.hbase_cache_blocks = false;

    this.parquet_file_size = 0L;

    this.explain_level = com.cloudera.impala.thrift.TExplainLevel.STANDARD;

    this.sync_ddl = false;

    this.disable_cached_reads = false;

    this.disable_outermost_topn = false;

    this.rm_initial_mem = 0L;

    this.query_timeout_s = 0;

    this.appx_count_distinct = false;

    this.disable_unsafe_spills = false;

    this.exec_single_node_rows_threshold = 100;

  }

  /**
   * Performs a deep copy on <i>other</i>.
   */
  public TQueryOptions(TQueryOptions other) {
    __isset_bitfield = other.__isset_bitfield;
    this.abort_on_error = other.abort_on_error;
    this.max_errors = other.max_errors;
    this.disable_codegen = other.disable_codegen;
    this.batch_size = other.batch_size;
    this.num_nodes = other.num_nodes;
    this.max_scan_range_length = other.max_scan_range_length;
    this.num_scanner_threads = other.num_scanner_threads;
    this.max_io_buffers = other.max_io_buffers;
    this.allow_unsupported_formats = other.allow_unsupported_formats;
    this.default_order_by_limit = other.default_order_by_limit;
    if (other.isSetDebug_action()) {
      this.debug_action = other.debug_action;
    }
    this.mem_limit = other.mem_limit;
    this.abort_on_default_limit_exceeded = other.abort_on_default_limit_exceeded;
    if (other.isSetCompression_codec()) {
      this.compression_codec = other.compression_codec;
    }
    this.hbase_caching = other.hbase_caching;
    this.hbase_cache_blocks = other.hbase_cache_blocks;
    this.parquet_file_size = other.parquet_file_size;
    if (other.isSetExplain_level()) {
      this.explain_level = other.explain_level;
    }
    this.sync_ddl = other.sync_ddl;
    if (other.isSetRequest_pool()) {
      this.request_pool = other.request_pool;
    }
    this.v_cpu_cores = other.v_cpu_cores;
    this.reservation_request_timeout = other.reservation_request_timeout;
    this.disable_cached_reads = other.disable_cached_reads;
    this.disable_outermost_topn = other.disable_outermost_topn;
    this.rm_initial_mem = other.rm_initial_mem;
    this.query_timeout_s = other.query_timeout_s;
    this.max_block_mgr_memory = other.max_block_mgr_memory;
    this.appx_count_distinct = other.appx_count_distinct;
    this.disable_unsafe_spills = other.disable_unsafe_spills;
    if (other.isSetSeq_compression_mode()) {
      this.seq_compression_mode = other.seq_compression_mode;
    }
    this.exec_single_node_rows_threshold = other.exec_single_node_rows_threshold;
  }

  public TQueryOptions deepCopy() {
    return new TQueryOptions(this);
  }

  @Override
  public void clear() {
    this.abort_on_error = false;

    this.max_errors = 0;

    this.disable_codegen = false;

    this.batch_size = 0;

    this.num_nodes = 0;

    this.max_scan_range_length = 0L;

    this.num_scanner_threads = 0;

    this.max_io_buffers = 0;

    this.allow_unsupported_formats = false;

    this.default_order_by_limit = -1L;

    this.debug_action = "";

    this.mem_limit = 0L;

    this.abort_on_default_limit_exceeded = false;

    this.compression_codec = null;
    this.hbase_caching = 0;

    this.hbase_cache_blocks = false;

    this.parquet_file_size = 0L;

    this.explain_level = com.cloudera.impala.thrift.TExplainLevel.STANDARD;

    this.sync_ddl = false;

    this.request_pool = null;
    setV_cpu_coresIsSet(false);
    this.v_cpu_cores = 0;
    setReservation_request_timeoutIsSet(false);
    this.reservation_request_timeout = 0;
    this.disable_cached_reads = false;

    this.disable_outermost_topn = false;

    this.rm_initial_mem = 0L;

    this.query_timeout_s = 0;

    setMax_block_mgr_memoryIsSet(false);
    this.max_block_mgr_memory = 0;
    this.appx_count_distinct = false;

    this.disable_unsafe_spills = false;

    this.seq_compression_mode = null;
    this.exec_single_node_rows_threshold = 100;

  }

  public boolean isAbort_on_error() {
    return this.abort_on_error;
  }

  public TQueryOptions setAbort_on_error(boolean abort_on_error) {
    this.abort_on_error = abort_on_error;
    setAbort_on_errorIsSet(true);
    return this;
  }

  public void unsetAbort_on_error() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ABORT_ON_ERROR_ISSET_ID);
  }

  /** Returns true if field abort_on_error is set (has been assigned a value) and false otherwise */
  public boolean isSetAbort_on_error() {
    return EncodingUtils.testBit(__isset_bitfield, __ABORT_ON_ERROR_ISSET_ID);
  }

  public void setAbort_on_errorIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ABORT_ON_ERROR_ISSET_ID, value);
  }

  public int getMax_errors() {
    return this.max_errors;
  }

  public TQueryOptions setMax_errors(int max_errors) {
    this.max_errors = max_errors;
    setMax_errorsIsSet(true);
    return this;
  }

  public void unsetMax_errors() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAX_ERRORS_ISSET_ID);
  }

  /** Returns true if field max_errors is set (has been assigned a value) and false otherwise */
  public boolean isSetMax_errors() {
    return EncodingUtils.testBit(__isset_bitfield, __MAX_ERRORS_ISSET_ID);
  }

  public void setMax_errorsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAX_ERRORS_ISSET_ID, value);
  }

  public boolean isDisable_codegen() {
    return this.disable_codegen;
  }

  public TQueryOptions setDisable_codegen(boolean disable_codegen) {
    this.disable_codegen = disable_codegen;
    setDisable_codegenIsSet(true);
    return this;
  }

  public void unsetDisable_codegen() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DISABLE_CODEGEN_ISSET_ID);
  }

  /** Returns true if field disable_codegen is set (has been assigned a value) and false otherwise */
  public boolean isSetDisable_codegen() {
    return EncodingUtils.testBit(__isset_bitfield, __DISABLE_CODEGEN_ISSET_ID);
  }

  public void setDisable_codegenIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DISABLE_CODEGEN_ISSET_ID, value);
  }

  public int getBatch_size() {
    return this.batch_size;
  }

  public TQueryOptions setBatch_size(int batch_size) {
    this.batch_size = batch_size;
    setBatch_sizeIsSet(true);
    return this;
  }

  public void unsetBatch_size() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BATCH_SIZE_ISSET_ID);
  }

  /** Returns true if field batch_size is set (has been assigned a value) and false otherwise */
  public boolean isSetBatch_size() {
    return EncodingUtils.testBit(__isset_bitfield, __BATCH_SIZE_ISSET_ID);
  }

  public void setBatch_sizeIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BATCH_SIZE_ISSET_ID, value);
  }

  public int getNum_nodes() {
    return this.num_nodes;
  }

  public TQueryOptions setNum_nodes(int num_nodes) {
    this.num_nodes = num_nodes;
    setNum_nodesIsSet(true);
    return this;
  }

  public void unsetNum_nodes() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_NODES_ISSET_ID);
  }

  /** Returns true if field num_nodes is set (has been assigned a value) and false otherwise */
  public boolean isSetNum_nodes() {
    return EncodingUtils.testBit(__isset_bitfield, __NUM_NODES_ISSET_ID);
  }

  public void setNum_nodesIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_NODES_ISSET_ID, value);
  }

  public long getMax_scan_range_length() {
    return this.max_scan_range_length;
  }

  public TQueryOptions setMax_scan_range_length(long max_scan_range_length) {
    this.max_scan_range_length = max_scan_range_length;
    setMax_scan_range_lengthIsSet(true);
    return this;
  }

  public void unsetMax_scan_range_length() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAX_SCAN_RANGE_LENGTH_ISSET_ID);
  }

  /** Returns true if field max_scan_range_length is set (has been assigned a value) and false otherwise */
  public boolean isSetMax_scan_range_length() {
    return EncodingUtils.testBit(__isset_bitfield, __MAX_SCAN_RANGE_LENGTH_ISSET_ID);
  }

  public void setMax_scan_range_lengthIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAX_SCAN_RANGE_LENGTH_ISSET_ID, value);
  }

  public int getNum_scanner_threads() {
    return this.num_scanner_threads;
  }

  public TQueryOptions setNum_scanner_threads(int num_scanner_threads) {
    this.num_scanner_threads = num_scanner_threads;
    setNum_scanner_threadsIsSet(true);
    return this;
  }

  public void unsetNum_scanner_threads() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUM_SCANNER_THREADS_ISSET_ID);
  }

  /** Returns true if field num_scanner_threads is set (has been assigned a value) and false otherwise */
  public boolean isSetNum_scanner_threads() {
    return EncodingUtils.testBit(__isset_bitfield, __NUM_SCANNER_THREADS_ISSET_ID);
  }

  public void setNum_scanner_threadsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUM_SCANNER_THREADS_ISSET_ID, value);
  }

  public int getMax_io_buffers() {
    return this.max_io_buffers;
  }

  public TQueryOptions setMax_io_buffers(int max_io_buffers) {
    this.max_io_buffers = max_io_buffers;
    setMax_io_buffersIsSet(true);
    return this;
  }

  public void unsetMax_io_buffers() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAX_IO_BUFFERS_ISSET_ID);
  }

  /** Returns true if field max_io_buffers is set (has been assigned a value) and false otherwise */
  public boolean isSetMax_io_buffers() {
    return EncodingUtils.testBit(__isset_bitfield, __MAX_IO_BUFFERS_ISSET_ID);
  }

  public void setMax_io_buffersIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAX_IO_BUFFERS_ISSET_ID, value);
  }

  public boolean isAllow_unsupported_formats() {
    return this.allow_unsupported_formats;
  }

  public TQueryOptions setAllow_unsupported_formats(boolean allow_unsupported_formats) {
    this.allow_unsupported_formats = allow_unsupported_formats;
    setAllow_unsupported_formatsIsSet(true);
    return this;
  }

  public void unsetAllow_unsupported_formats() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ALLOW_UNSUPPORTED_FORMATS_ISSET_ID);
  }

  /** Returns true if field allow_unsupported_formats is set (has been assigned a value) and false otherwise */
  public boolean isSetAllow_unsupported_formats() {
    return EncodingUtils.testBit(__isset_bitfield, __ALLOW_UNSUPPORTED_FORMATS_ISSET_ID);
  }

  public void setAllow_unsupported_formatsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ALLOW_UNSUPPORTED_FORMATS_ISSET_ID, value);
  }

  public long getDefault_order_by_limit() {
    return this.default_order_by_limit;
  }

  public TQueryOptions setDefault_order_by_limit(long default_order_by_limit) {
    this.default_order_by_limit = default_order_by_limit;
    setDefault_order_by_limitIsSet(true);
    return this;
  }

  public void unsetDefault_order_by_limit() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEFAULT_ORDER_BY_LIMIT_ISSET_ID);
  }

  /** Returns true if field default_order_by_limit is set (has been assigned a value) and false otherwise */
  public boolean isSetDefault_order_by_limit() {
    return EncodingUtils.testBit(__isset_bitfield, __DEFAULT_ORDER_BY_LIMIT_ISSET_ID);
  }

  public void setDefault_order_by_limitIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEFAULT_ORDER_BY_LIMIT_ISSET_ID, value);
  }

  public String getDebug_action() {
    return this.debug_action;
  }

  public TQueryOptions setDebug_action(String debug_action) {
    this.debug_action = debug_action;
    return this;
  }

  public void unsetDebug_action() {
    this.debug_action = null;
  }

  /** Returns true if field debug_action is set (has been assigned a value) and false otherwise */
  public boolean isSetDebug_action() {
    return this.debug_action != null;
  }

  public void setDebug_actionIsSet(boolean value) {
    if (!value) {
      this.debug_action = null;
    }
  }

  public long getMem_limit() {
    return this.mem_limit;
  }

  public TQueryOptions setMem_limit(long mem_limit) {
    this.mem_limit = mem_limit;
    setMem_limitIsSet(true);
    return this;
  }

  public void unsetMem_limit() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MEM_LIMIT_ISSET_ID);
  }

  /** Returns true if field mem_limit is set (has been assigned a value) and false otherwise */
  public boolean isSetMem_limit() {
    return EncodingUtils.testBit(__isset_bitfield, __MEM_LIMIT_ISSET_ID);
  }

  public void setMem_limitIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MEM_LIMIT_ISSET_ID, value);
  }

  public boolean isAbort_on_default_limit_exceeded() {
    return this.abort_on_default_limit_exceeded;
  }

  public TQueryOptions setAbort_on_default_limit_exceeded(boolean abort_on_default_limit_exceeded) {
    this.abort_on_default_limit_exceeded = abort_on_default_limit_exceeded;
    setAbort_on_default_limit_exceededIsSet(true);
    return this;
  }

  public void unsetAbort_on_default_limit_exceeded() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ABORT_ON_DEFAULT_LIMIT_EXCEEDED_ISSET_ID);
  }

  /** Returns true if field abort_on_default_limit_exceeded is set (has been assigned a value) and false otherwise */
  public boolean isSetAbort_on_default_limit_exceeded() {
    return EncodingUtils.testBit(__isset_bitfield, __ABORT_ON_DEFAULT_LIMIT_EXCEEDED_ISSET_ID);
  }

  public void setAbort_on_default_limit_exceededIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ABORT_ON_DEFAULT_LIMIT_EXCEEDED_ISSET_ID, value);
  }

  /**
   * 
   * @see com.cloudera.impala.thrift.THdfsCompression
   */
  public com.cloudera.impala.thrift.THdfsCompression getCompression_codec() {
    return this.compression_codec;
  }

  /**
   * 
   * @see com.cloudera.impala.thrift.THdfsCompression
   */
  public TQueryOptions setCompression_codec(com.cloudera.impala.thrift.THdfsCompression compression_codec) {
    this.compression_codec = compression_codec;
    return this;
  }

  public void unsetCompression_codec() {
    this.compression_codec = null;
  }

  /** Returns true if field compression_codec is set (has been assigned a value) and false otherwise */
  public boolean isSetCompression_codec() {
    return this.compression_codec != null;
  }

  public void setCompression_codecIsSet(boolean value) {
    if (!value) {
      this.compression_codec = null;
    }
  }

  public int getHbase_caching() {
    return this.hbase_caching;
  }

  public TQueryOptions setHbase_caching(int hbase_caching) {
    this.hbase_caching = hbase_caching;
    setHbase_cachingIsSet(true);
    return this;
  }

  public void unsetHbase_caching() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HBASE_CACHING_ISSET_ID);
  }

  /** Returns true if field hbase_caching is set (has been assigned a value) and false otherwise */
  public boolean isSetHbase_caching() {
    return EncodingUtils.testBit(__isset_bitfield, __HBASE_CACHING_ISSET_ID);
  }

  public void setHbase_cachingIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HBASE_CACHING_ISSET_ID, value);
  }

  public boolean isHbase_cache_blocks() {
    return this.hbase_cache_blocks;
  }

  public TQueryOptions setHbase_cache_blocks(boolean hbase_cache_blocks) {
    this.hbase_cache_blocks = hbase_cache_blocks;
    setHbase_cache_blocksIsSet(true);
    return this;
  }

  public void unsetHbase_cache_blocks() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HBASE_CACHE_BLOCKS_ISSET_ID);
  }

  /** Returns true if field hbase_cache_blocks is set (has been assigned a value) and false otherwise */
  public boolean isSetHbase_cache_blocks() {
    return EncodingUtils.testBit(__isset_bitfield, __HBASE_CACHE_BLOCKS_ISSET_ID);
  }

  public void setHbase_cache_blocksIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HBASE_CACHE_BLOCKS_ISSET_ID, value);
  }

  public long getParquet_file_size() {
    return this.parquet_file_size;
  }

  public TQueryOptions setParquet_file_size(long parquet_file_size) {
    this.parquet_file_size = parquet_file_size;
    setParquet_file_sizeIsSet(true);
    return this;
  }

  public void unsetParquet_file_size() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARQUET_FILE_SIZE_ISSET_ID);
  }

  /** Returns true if field parquet_file_size is set (has been assigned a value) and false otherwise */
  public boolean isSetParquet_file_size() {
    return EncodingUtils.testBit(__isset_bitfield, __PARQUET_FILE_SIZE_ISSET_ID);
  }

  public void setParquet_file_sizeIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARQUET_FILE_SIZE_ISSET_ID, value);
  }

  /**
   * 
   * @see com.cloudera.impala.thrift.TExplainLevel
   */
  public com.cloudera.impala.thrift.TExplainLevel getExplain_level() {
    return this.explain_level;
  }

  /**
   * 
   * @see com.cloudera.impala.thrift.TExplainLevel
   */
  public TQueryOptions setExplain_level(com.cloudera.impala.thrift.TExplainLevel explain_level) {
    this.explain_level = explain_level;
    return this;
  }

  public void unsetExplain_level() {
    this.explain_level = null;
  }

  /** Returns true if field explain_level is set (has been assigned a value) and false otherwise */
  public boolean isSetExplain_level() {
    return this.explain_level != null;
  }

  public void setExplain_levelIsSet(boolean value) {
    if (!value) {
      this.explain_level = null;
    }
  }

  public boolean isSync_ddl() {
    return this.sync_ddl;
  }

  public TQueryOptions setSync_ddl(boolean sync_ddl) {
    this.sync_ddl = sync_ddl;
    setSync_ddlIsSet(true);
    return this;
  }

  public void unsetSync_ddl() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SYNC_DDL_ISSET_ID);
  }

  /** Returns true if field sync_ddl is set (has been assigned a value) and false otherwise */
  public boolean isSetSync_ddl() {
    return EncodingUtils.testBit(__isset_bitfield, __SYNC_DDL_ISSET_ID);
  }

  public void setSync_ddlIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SYNC_DDL_ISSET_ID, value);
  }

  public String getRequest_pool() {
    return this.request_pool;
  }

  public TQueryOptions setRequest_pool(String request_pool) {
    this.request_pool = request_pool;
    return this;
  }

  public void unsetRequest_pool() {
    this.request_pool = null;
  }

  /** Returns true if field request_pool is set (has been assigned a value) and false otherwise */
  public boolean isSetRequest_pool() {
    return this.request_pool != null;
  }

  public void setRequest_poolIsSet(boolean value) {
    if (!value) {
      this.request_pool = null;
    }
  }

  public short getV_cpu_cores() {
    return this.v_cpu_cores;
  }

  public TQueryOptions setV_cpu_cores(short v_cpu_cores) {
    this.v_cpu_cores = v_cpu_cores;
    setV_cpu_coresIsSet(true);
    return this;
  }

  public void unsetV_cpu_cores() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __V_CPU_CORES_ISSET_ID);
  }

  /** Returns true if field v_cpu_cores is set (has been assigned a value) and false otherwise */
  public boolean isSetV_cpu_cores() {
    return EncodingUtils.testBit(__isset_bitfield, __V_CPU_CORES_ISSET_ID);
  }

  public void setV_cpu_coresIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __V_CPU_CORES_ISSET_ID, value);
  }

  public long getReservation_request_timeout() {
    return this.reservation_request_timeout;
  }

  public TQueryOptions setReservation_request_timeout(long reservation_request_timeout) {
    this.reservation_request_timeout = reservation_request_timeout;
    setReservation_request_timeoutIsSet(true);
    return this;
  }

  public void unsetReservation_request_timeout() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RESERVATION_REQUEST_TIMEOUT_ISSET_ID);
  }

  /** Returns true if field reservation_request_timeout is set (has been assigned a value) and false otherwise */
  public boolean isSetReservation_request_timeout() {
    return EncodingUtils.testBit(__isset_bitfield, __RESERVATION_REQUEST_TIMEOUT_ISSET_ID);
  }

  public void setReservation_request_timeoutIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RESERVATION_REQUEST_TIMEOUT_ISSET_ID, value);
  }

  public boolean isDisable_cached_reads() {
    return this.disable_cached_reads;
  }

  public TQueryOptions setDisable_cached_reads(boolean disable_cached_reads) {
    this.disable_cached_reads = disable_cached_reads;
    setDisable_cached_readsIsSet(true);
    return this;
  }

  public void unsetDisable_cached_reads() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DISABLE_CACHED_READS_ISSET_ID);
  }

  /** Returns true if field disable_cached_reads is set (has been assigned a value) and false otherwise */
  public boolean isSetDisable_cached_reads() {
    return EncodingUtils.testBit(__isset_bitfield, __DISABLE_CACHED_READS_ISSET_ID);
  }

  public void setDisable_cached_readsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DISABLE_CACHED_READS_ISSET_ID, value);
  }

  public boolean isDisable_outermost_topn() {
    return this.disable_outermost_topn;
  }

  public TQueryOptions setDisable_outermost_topn(boolean disable_outermost_topn) {
    this.disable_outermost_topn = disable_outermost_topn;
    setDisable_outermost_topnIsSet(true);
    return this;
  }

  public void unsetDisable_outermost_topn() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DISABLE_OUTERMOST_TOPN_ISSET_ID);
  }

  /** Returns true if field disable_outermost_topn is set (has been assigned a value) and false otherwise */
  public boolean isSetDisable_outermost_topn() {
    return EncodingUtils.testBit(__isset_bitfield, __DISABLE_OUTERMOST_TOPN_ISSET_ID);
  }

  public void setDisable_outermost_topnIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DISABLE_OUTERMOST_TOPN_ISSET_ID, value);
  }

  public long getRm_initial_mem() {
    return this.rm_initial_mem;
  }

  public TQueryOptions setRm_initial_mem(long rm_initial_mem) {
    this.rm_initial_mem = rm_initial_mem;
    setRm_initial_memIsSet(true);
    return this;
  }

  public void unsetRm_initial_mem() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RM_INITIAL_MEM_ISSET_ID);
  }

  /** Returns true if field rm_initial_mem is set (has been assigned a value) and false otherwise */
  public boolean isSetRm_initial_mem() {
    return EncodingUtils.testBit(__isset_bitfield, __RM_INITIAL_MEM_ISSET_ID);
  }

  public void setRm_initial_memIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RM_INITIAL_MEM_ISSET_ID, value);
  }

  public int getQuery_timeout_s() {
    return this.query_timeout_s;
  }

  public TQueryOptions setQuery_timeout_s(int query_timeout_s) {
    this.query_timeout_s = query_timeout_s;
    setQuery_timeout_sIsSet(true);
    return this;
  }

  public void unsetQuery_timeout_s() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __QUERY_TIMEOUT_S_ISSET_ID);
  }

  /** Returns true if field query_timeout_s is set (has been assigned a value) and false otherwise */
  public boolean isSetQuery_timeout_s() {
    return EncodingUtils.testBit(__isset_bitfield, __QUERY_TIMEOUT_S_ISSET_ID);
  }

  public void setQuery_timeout_sIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __QUERY_TIMEOUT_S_ISSET_ID, value);
  }

  public long getMax_block_mgr_memory() {
    return this.max_block_mgr_memory;
  }

  public TQueryOptions setMax_block_mgr_memory(long max_block_mgr_memory) {
    this.max_block_mgr_memory = max_block_mgr_memory;
    setMax_block_mgr_memoryIsSet(true);
    return this;
  }

  public void unsetMax_block_mgr_memory() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAX_BLOCK_MGR_MEMORY_ISSET_ID);
  }

  /** Returns true if field max_block_mgr_memory is set (has been assigned a value) and false otherwise */
  public boolean isSetMax_block_mgr_memory() {
    return EncodingUtils.testBit(__isset_bitfield, __MAX_BLOCK_MGR_MEMORY_ISSET_ID);
  }

  public void setMax_block_mgr_memoryIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAX_BLOCK_MGR_MEMORY_ISSET_ID, value);
  }

  public boolean isAppx_count_distinct() {
    return this.appx_count_distinct;
  }

  public TQueryOptions setAppx_count_distinct(boolean appx_count_distinct) {
    this.appx_count_distinct = appx_count_distinct;
    setAppx_count_distinctIsSet(true);
    return this;
  }

  public void unsetAppx_count_distinct() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __APPX_COUNT_DISTINCT_ISSET_ID);
  }

  /** Returns true if field appx_count_distinct is set (has been assigned a value) and false otherwise */
  public boolean isSetAppx_count_distinct() {
    return EncodingUtils.testBit(__isset_bitfield, __APPX_COUNT_DISTINCT_ISSET_ID);
  }

  public void setAppx_count_distinctIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __APPX_COUNT_DISTINCT_ISSET_ID, value);
  }

  public boolean isDisable_unsafe_spills() {
    return this.disable_unsafe_spills;
  }

  public TQueryOptions setDisable_unsafe_spills(boolean disable_unsafe_spills) {
    this.disable_unsafe_spills = disable_unsafe_spills;
    setDisable_unsafe_spillsIsSet(true);
    return this;
  }

  public void unsetDisable_unsafe_spills() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DISABLE_UNSAFE_SPILLS_ISSET_ID);
  }

  /** Returns true if field disable_unsafe_spills is set (has been assigned a value) and false otherwise */
  public boolean isSetDisable_unsafe_spills() {
    return EncodingUtils.testBit(__isset_bitfield, __DISABLE_UNSAFE_SPILLS_ISSET_ID);
  }

  public void setDisable_unsafe_spillsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DISABLE_UNSAFE_SPILLS_ISSET_ID, value);
  }

  /**
   * 
   * @see com.cloudera.impala.thrift.THdfsSeqCompressionMode
   */
  public com.cloudera.impala.thrift.THdfsSeqCompressionMode getSeq_compression_mode() {
    return this.seq_compression_mode;
  }

  /**
   * 
   * @see com.cloudera.impala.thrift.THdfsSeqCompressionMode
   */
  public TQueryOptions setSeq_compression_mode(com.cloudera.impala.thrift.THdfsSeqCompressionMode seq_compression_mode) {
    this.seq_compression_mode = seq_compression_mode;
    return this;
  }

  public void unsetSeq_compression_mode() {
    this.seq_compression_mode = null;
  }

  /** Returns true if field seq_compression_mode is set (has been assigned a value) and false otherwise */
  public boolean isSetSeq_compression_mode() {
    return this.seq_compression_mode != null;
  }

  public void setSeq_compression_modeIsSet(boolean value) {
    if (!value) {
      this.seq_compression_mode = null;
    }
  }

  public int getExec_single_node_rows_threshold() {
    return this.exec_single_node_rows_threshold;
  }

  public TQueryOptions setExec_single_node_rows_threshold(int exec_single_node_rows_threshold) {
    this.exec_single_node_rows_threshold = exec_single_node_rows_threshold;
    setExec_single_node_rows_thresholdIsSet(true);
    return this;
  }

  public void unsetExec_single_node_rows_threshold() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXEC_SINGLE_NODE_ROWS_THRESHOLD_ISSET_ID);
  }

  /** Returns true if field exec_single_node_rows_threshold is set (has been assigned a value) and false otherwise */
  public boolean isSetExec_single_node_rows_threshold() {
    return EncodingUtils.testBit(__isset_bitfield, __EXEC_SINGLE_NODE_ROWS_THRESHOLD_ISSET_ID);
  }

  public void setExec_single_node_rows_thresholdIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXEC_SINGLE_NODE_ROWS_THRESHOLD_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ABORT_ON_ERROR:
      if (value == null) {
        unsetAbort_on_error();
      } else {
        setAbort_on_error((Boolean)value);
      }
      break;

    case MAX_ERRORS:
      if (value == null) {
        unsetMax_errors();
      } else {
        setMax_errors((Integer)value);
      }
      break;

    case DISABLE_CODEGEN:
      if (value == null) {
        unsetDisable_codegen();
      } else {
        setDisable_codegen((Boolean)value);
      }
      break;

    case BATCH_SIZE:
      if (value == null) {
        unsetBatch_size();
      } else {
        setBatch_size((Integer)value);
      }
      break;

    case NUM_NODES:
      if (value == null) {
        unsetNum_nodes();
      } else {
        setNum_nodes((Integer)value);
      }
      break;

    case MAX_SCAN_RANGE_LENGTH:
      if (value == null) {
        unsetMax_scan_range_length();
      } else {
        setMax_scan_range_length((Long)value);
      }
      break;

    case NUM_SCANNER_THREADS:
      if (value == null) {
        unsetNum_scanner_threads();
      } else {
        setNum_scanner_threads((Integer)value);
      }
      break;

    case MAX_IO_BUFFERS:
      if (value == null) {
        unsetMax_io_buffers();
      } else {
        setMax_io_buffers((Integer)value);
      }
      break;

    case ALLOW_UNSUPPORTED_FORMATS:
      if (value == null) {
        unsetAllow_unsupported_formats();
      } else {
        setAllow_unsupported_formats((Boolean)value);
      }
      break;

    case DEFAULT_ORDER_BY_LIMIT:
      if (value == null) {
        unsetDefault_order_by_limit();
      } else {
        setDefault_order_by_limit((Long)value);
      }
      break;

    case DEBUG_ACTION:
      if (value == null) {
        unsetDebug_action();
      } else {
        setDebug_action((String)value);
      }
      break;

    case MEM_LIMIT:
      if (value == null) {
        unsetMem_limit();
      } else {
        setMem_limit((Long)value);
      }
      break;

    case ABORT_ON_DEFAULT_LIMIT_EXCEEDED:
      if (value == null) {
        unsetAbort_on_default_limit_exceeded();
      } else {
        setAbort_on_default_limit_exceeded((Boolean)value);
      }
      break;

    case COMPRESSION_CODEC:
      if (value == null) {
        unsetCompression_codec();
      } else {
        setCompression_codec((com.cloudera.impala.thrift.THdfsCompression)value);
      }
      break;

    case HBASE_CACHING:
      if (value == null) {
        unsetHbase_caching();
      } else {
        setHbase_caching((Integer)value);
      }
      break;

    case HBASE_CACHE_BLOCKS:
      if (value == null) {
        unsetHbase_cache_blocks();
      } else {
        setHbase_cache_blocks((Boolean)value);
      }
      break;

    case PARQUET_FILE_SIZE:
      if (value == null) {
        unsetParquet_file_size();
      } else {
        setParquet_file_size((Long)value);
      }
      break;

    case EXPLAIN_LEVEL:
      if (value == null) {
        unsetExplain_level();
      } else {
        setExplain_level((com.cloudera.impala.thrift.TExplainLevel)value);
      }
      break;

    case SYNC_DDL:
      if (value == null) {
        unsetSync_ddl();
      } else {
        setSync_ddl((Boolean)value);
      }
      break;

    case REQUEST_POOL:
      if (value == null) {
        unsetRequest_pool();
      } else {
        setRequest_pool((String)value);
      }
      break;

    case V_CPU_CORES:
      if (value == null) {
        unsetV_cpu_cores();
      } else {
        setV_cpu_cores((Short)value);
      }
      break;

    case RESERVATION_REQUEST_TIMEOUT:
      if (value == null) {
        unsetReservation_request_timeout();
      } else {
        setReservation_request_timeout((Long)value);
      }
      break;

    case DISABLE_CACHED_READS:
      if (value == null) {
        unsetDisable_cached_reads();
      } else {
        setDisable_cached_reads((Boolean)value);
      }
      break;

    case DISABLE_OUTERMOST_TOPN:
      if (value == null) {
        unsetDisable_outermost_topn();
      } else {
        setDisable_outermost_topn((Boolean)value);
      }
      break;

    case RM_INITIAL_MEM:
      if (value == null) {
        unsetRm_initial_mem();
      } else {
        setRm_initial_mem((Long)value);
      }
      break;

    case QUERY_TIMEOUT_S:
      if (value == null) {
        unsetQuery_timeout_s();
      } else {
        setQuery_timeout_s((Integer)value);
      }
      break;

    case MAX_BLOCK_MGR_MEMORY:
      if (value == null) {
        unsetMax_block_mgr_memory();
      } else {
        setMax_block_mgr_memory((Long)value);
      }
      break;

    case APPX_COUNT_DISTINCT:
      if (value == null) {
        unsetAppx_count_distinct();
      } else {
        setAppx_count_distinct((Boolean)value);
      }
      break;

    case DISABLE_UNSAFE_SPILLS:
      if (value == null) {
        unsetDisable_unsafe_spills();
      } else {
        setDisable_unsafe_spills((Boolean)value);
      }
      break;

    case SEQ_COMPRESSION_MODE:
      if (value == null) {
        unsetSeq_compression_mode();
      } else {
        setSeq_compression_mode((com.cloudera.impala.thrift.THdfsSeqCompressionMode)value);
      }
      break;

    case EXEC_SINGLE_NODE_ROWS_THRESHOLD:
      if (value == null) {
        unsetExec_single_node_rows_threshold();
      } else {
        setExec_single_node_rows_threshold((Integer)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ABORT_ON_ERROR:
      return Boolean.valueOf(isAbort_on_error());

    case MAX_ERRORS:
      return Integer.valueOf(getMax_errors());

    case DISABLE_CODEGEN:
      return Boolean.valueOf(isDisable_codegen());

    case BATCH_SIZE:
      return Integer.valueOf(getBatch_size());

    case NUM_NODES:
      return Integer.valueOf(getNum_nodes());

    case MAX_SCAN_RANGE_LENGTH:
      return Long.valueOf(getMax_scan_range_length());

    case NUM_SCANNER_THREADS:
      return Integer.valueOf(getNum_scanner_threads());

    case MAX_IO_BUFFERS:
      return Integer.valueOf(getMax_io_buffers());

    case ALLOW_UNSUPPORTED_FORMATS:
      return Boolean.valueOf(isAllow_unsupported_formats());

    case DEFAULT_ORDER_BY_LIMIT:
      return Long.valueOf(getDefault_order_by_limit());

    case DEBUG_ACTION:
      return getDebug_action();

    case MEM_LIMIT:
      return Long.valueOf(getMem_limit());

    case ABORT_ON_DEFAULT_LIMIT_EXCEEDED:
      return Boolean.valueOf(isAbort_on_default_limit_exceeded());

    case COMPRESSION_CODEC:
      return getCompression_codec();

    case HBASE_CACHING:
      return Integer.valueOf(getHbase_caching());

    case HBASE_CACHE_BLOCKS:
      return Boolean.valueOf(isHbase_cache_blocks());

    case PARQUET_FILE_SIZE:
      return Long.valueOf(getParquet_file_size());

    case EXPLAIN_LEVEL:
      return getExplain_level();

    case SYNC_DDL:
      return Boolean.valueOf(isSync_ddl());

    case REQUEST_POOL:
      return getRequest_pool();

    case V_CPU_CORES:
      return Short.valueOf(getV_cpu_cores());

    case RESERVATION_REQUEST_TIMEOUT:
      return Long.valueOf(getReservation_request_timeout());

    case DISABLE_CACHED_READS:
      return Boolean.valueOf(isDisable_cached_reads());

    case DISABLE_OUTERMOST_TOPN:
      return Boolean.valueOf(isDisable_outermost_topn());

    case RM_INITIAL_MEM:
      return Long.valueOf(getRm_initial_mem());

    case QUERY_TIMEOUT_S:
      return Integer.valueOf(getQuery_timeout_s());

    case MAX_BLOCK_MGR_MEMORY:
      return Long.valueOf(getMax_block_mgr_memory());

    case APPX_COUNT_DISTINCT:
      return Boolean.valueOf(isAppx_count_distinct());

    case DISABLE_UNSAFE_SPILLS:
      return Boolean.valueOf(isDisable_unsafe_spills());

    case SEQ_COMPRESSION_MODE:
      return getSeq_compression_mode();

    case EXEC_SINGLE_NODE_ROWS_THRESHOLD:
      return Integer.valueOf(getExec_single_node_rows_threshold());

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case ABORT_ON_ERROR:
      return isSetAbort_on_error();
    case MAX_ERRORS:
      return isSetMax_errors();
    case DISABLE_CODEGEN:
      return isSetDisable_codegen();
    case BATCH_SIZE:
      return isSetBatch_size();
    case NUM_NODES:
      return isSetNum_nodes();
    case MAX_SCAN_RANGE_LENGTH:
      return isSetMax_scan_range_length();
    case NUM_SCANNER_THREADS:
      return isSetNum_scanner_threads();
    case MAX_IO_BUFFERS:
      return isSetMax_io_buffers();
    case ALLOW_UNSUPPORTED_FORMATS:
      return isSetAllow_unsupported_formats();
    case DEFAULT_ORDER_BY_LIMIT:
      return isSetDefault_order_by_limit();
    case DEBUG_ACTION:
      return isSetDebug_action();
    case MEM_LIMIT:
      return isSetMem_limit();
    case ABORT_ON_DEFAULT_LIMIT_EXCEEDED:
      return isSetAbort_on_default_limit_exceeded();
    case COMPRESSION_CODEC:
      return isSetCompression_codec();
    case HBASE_CACHING:
      return isSetHbase_caching();
    case HBASE_CACHE_BLOCKS:
      return isSetHbase_cache_blocks();
    case PARQUET_FILE_SIZE:
      return isSetParquet_file_size();
    case EXPLAIN_LEVEL:
      return isSetExplain_level();
    case SYNC_DDL:
      return isSetSync_ddl();
    case REQUEST_POOL:
      return isSetRequest_pool();
    case V_CPU_CORES:
      return isSetV_cpu_cores();
    case RESERVATION_REQUEST_TIMEOUT:
      return isSetReservation_request_timeout();
    case DISABLE_CACHED_READS:
      return isSetDisable_cached_reads();
    case DISABLE_OUTERMOST_TOPN:
      return isSetDisable_outermost_topn();
    case RM_INITIAL_MEM:
      return isSetRm_initial_mem();
    case QUERY_TIMEOUT_S:
      return isSetQuery_timeout_s();
    case MAX_BLOCK_MGR_MEMORY:
      return isSetMax_block_mgr_memory();
    case APPX_COUNT_DISTINCT:
      return isSetAppx_count_distinct();
    case DISABLE_UNSAFE_SPILLS:
      return isSetDisable_unsafe_spills();
    case SEQ_COMPRESSION_MODE:
      return isSetSeq_compression_mode();
    case EXEC_SINGLE_NODE_ROWS_THRESHOLD:
      return isSetExec_single_node_rows_threshold();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof TQueryOptions)
      return this.equals((TQueryOptions)that);
    return false;
  }

  public boolean equals(TQueryOptions that) {
    if (that == null)
      return false;

    boolean this_present_abort_on_error = true && this.isSetAbort_on_error();
    boolean that_present_abort_on_error = true && that.isSetAbort_on_error();
    if (this_present_abort_on_error || that_present_abort_on_error) {
      if (!(this_present_abort_on_error && that_present_abort_on_error))
        return false;
      if (this.abort_on_error != that.abort_on_error)
        return false;
    }

    boolean this_present_max_errors = true && this.isSetMax_errors();
    boolean that_present_max_errors = true && that.isSetMax_errors();
    if (this_present_max_errors || that_present_max_errors) {
      if (!(this_present_max_errors && that_present_max_errors))
        return false;
      if (this.max_errors != that.max_errors)
        return false;
    }

    boolean this_present_disable_codegen = true && this.isSetDisable_codegen();
    boolean that_present_disable_codegen = true && that.isSetDisable_codegen();
    if (this_present_disable_codegen || that_present_disable_codegen) {
      if (!(this_present_disable_codegen && that_present_disable_codegen))
        return false;
      if (this.disable_codegen != that.disable_codegen)
        return false;
    }

    boolean this_present_batch_size = true && this.isSetBatch_size();
    boolean that_present_batch_size = true && that.isSetBatch_size();
    if (this_present_batch_size || that_present_batch_size) {
      if (!(this_present_batch_size && that_present_batch_size))
        return false;
      if (this.batch_size != that.batch_size)
        return false;
    }

    boolean this_present_num_nodes = true && this.isSetNum_nodes();
    boolean that_present_num_nodes = true && that.isSetNum_nodes();
    if (this_present_num_nodes || that_present_num_nodes) {
      if (!(this_present_num_nodes && that_present_num_nodes))
        return false;
      if (this.num_nodes != that.num_nodes)
        return false;
    }

    boolean this_present_max_scan_range_length = true && this.isSetMax_scan_range_length();
    boolean that_present_max_scan_range_length = true && that.isSetMax_scan_range_length();
    if (this_present_max_scan_range_length || that_present_max_scan_range_length) {
      if (!(this_present_max_scan_range_length && that_present_max_scan_range_length))
        return false;
      if (this.max_scan_range_length != that.max_scan_range_length)
        return false;
    }

    boolean this_present_num_scanner_threads = true && this.isSetNum_scanner_threads();
    boolean that_present_num_scanner_threads = true && that.isSetNum_scanner_threads();
    if (this_present_num_scanner_threads || that_present_num_scanner_threads) {
      if (!(this_present_num_scanner_threads && that_present_num_scanner_threads))
        return false;
      if (this.num_scanner_threads != that.num_scanner_threads)
        return false;
    }

    boolean this_present_max_io_buffers = true && this.isSetMax_io_buffers();
    boolean that_present_max_io_buffers = true && that.isSetMax_io_buffers();
    if (this_present_max_io_buffers || that_present_max_io_buffers) {
      if (!(this_present_max_io_buffers && that_present_max_io_buffers))
        return false;
      if (this.max_io_buffers != that.max_io_buffers)
        return false;
    }

    boolean this_present_allow_unsupported_formats = true && this.isSetAllow_unsupported_formats();
    boolean that_present_allow_unsupported_formats = true && that.isSetAllow_unsupported_formats();
    if (this_present_allow_unsupported_formats || that_present_allow_unsupported_formats) {
      if (!(this_present_allow_unsupported_formats && that_present_allow_unsupported_formats))
        return false;
      if (this.allow_unsupported_formats != that.allow_unsupported_formats)
        return false;
    }

    boolean this_present_default_order_by_limit = true && this.isSetDefault_order_by_limit();
    boolean that_present_default_order_by_limit = true && that.isSetDefault_order_by_limit();
    if (this_present_default_order_by_limit || that_present_default_order_by_limit) {
      if (!(this_present_default_order_by_limit && that_present_default_order_by_limit))
        return false;
      if (this.default_order_by_limit != that.default_order_by_limit)
        return false;
    }

    boolean this_present_debug_action = true && this.isSetDebug_action();
    boolean that_present_debug_action = true && that.isSetDebug_action();
    if (this_present_debug_action || that_present_debug_action) {
      if (!(this_present_debug_action && that_present_debug_action))
        return false;
      if (!this.debug_action.equals(that.debug_action))
        return false;
    }

    boolean this_present_mem_limit = true && this.isSetMem_limit();
    boolean that_present_mem_limit = true && that.isSetMem_limit();
    if (this_present_mem_limit || that_present_mem_limit) {
      if (!(this_present_mem_limit && that_present_mem_limit))
        return false;
      if (this.mem_limit != that.mem_limit)
        return false;
    }

    boolean this_present_abort_on_default_limit_exceeded = true && this.isSetAbort_on_default_limit_exceeded();
    boolean that_present_abort_on_default_limit_exceeded = true && that.isSetAbort_on_default_limit_exceeded();
    if (this_present_abort_on_default_limit_exceeded || that_present_abort_on_default_limit_exceeded) {
      if (!(this_present_abort_on_default_limit_exceeded && that_present_abort_on_default_limit_exceeded))
        return false;
      if (this.abort_on_default_limit_exceeded != that.abort_on_default_limit_exceeded)
        return false;
    }

    boolean this_present_compression_codec = true && this.isSetCompression_codec();
    boolean that_present_compression_codec = true && that.isSetCompression_codec();
    if (this_present_compression_codec || that_present_compression_codec) {
      if (!(this_present_compression_codec && that_present_compression_codec))
        return false;
      if (!this.compression_codec.equals(that.compression_codec))
        return false;
    }

    boolean this_present_hbase_caching = true && this.isSetHbase_caching();
    boolean that_present_hbase_caching = true && that.isSetHbase_caching();
    if (this_present_hbase_caching || that_present_hbase_caching) {
      if (!(this_present_hbase_caching && that_present_hbase_caching))
        return false;
      if (this.hbase_caching != that.hbase_caching)
        return false;
    }

    boolean this_present_hbase_cache_blocks = true && this.isSetHbase_cache_blocks();
    boolean that_present_hbase_cache_blocks = true && that.isSetHbase_cache_blocks();
    if (this_present_hbase_cache_blocks || that_present_hbase_cache_blocks) {
      if (!(this_present_hbase_cache_blocks && that_present_hbase_cache_blocks))
        return false;
      if (this.hbase_cache_blocks != that.hbase_cache_blocks)
        return false;
    }

    boolean this_present_parquet_file_size = true && this.isSetParquet_file_size();
    boolean that_present_parquet_file_size = true && that.isSetParquet_file_size();
    if (this_present_parquet_file_size || that_present_parquet_file_size) {
      if (!(this_present_parquet_file_size && that_present_parquet_file_size))
        return false;
      if (this.parquet_file_size != that.parquet_file_size)
        return false;
    }

    boolean this_present_explain_level = true && this.isSetExplain_level();
    boolean that_present_explain_level = true && that.isSetExplain_level();
    if (this_present_explain_level || that_present_explain_level) {
      if (!(this_present_explain_level && that_present_explain_level))
        return false;
      if (!this.explain_level.equals(that.explain_level))
        return false;
    }

    boolean this_present_sync_ddl = true && this.isSetSync_ddl();
    boolean that_present_sync_ddl = true && that.isSetSync_ddl();
    if (this_present_sync_ddl || that_present_sync_ddl) {
      if (!(this_present_sync_ddl && that_present_sync_ddl))
        return false;
      if (this.sync_ddl != that.sync_ddl)
        return false;
    }

    boolean this_present_request_pool = true && this.isSetRequest_pool();
    boolean that_present_request_pool = true && that.isSetRequest_pool();
    if (this_present_request_pool || that_present_request_pool) {
      if (!(this_present_request_pool && that_present_request_pool))
        return false;
      if (!this.request_pool.equals(that.request_pool))
        return false;
    }

    boolean this_present_v_cpu_cores = true && this.isSetV_cpu_cores();
    boolean that_present_v_cpu_cores = true && that.isSetV_cpu_cores();
    if (this_present_v_cpu_cores || that_present_v_cpu_cores) {
      if (!(this_present_v_cpu_cores && that_present_v_cpu_cores))
        return false;
      if (this.v_cpu_cores != that.v_cpu_cores)
        return false;
    }

    boolean this_present_reservation_request_timeout = true && this.isSetReservation_request_timeout();
    boolean that_present_reservation_request_timeout = true && that.isSetReservation_request_timeout();
    if (this_present_reservation_request_timeout || that_present_reservation_request_timeout) {
      if (!(this_present_reservation_request_timeout && that_present_reservation_request_timeout))
        return false;
      if (this.reservation_request_timeout != that.reservation_request_timeout)
        return false;
    }

    boolean this_present_disable_cached_reads = true && this.isSetDisable_cached_reads();
    boolean that_present_disable_cached_reads = true && that.isSetDisable_cached_reads();
    if (this_present_disable_cached_reads || that_present_disable_cached_reads) {
      if (!(this_present_disable_cached_reads && that_present_disable_cached_reads))
        return false;
      if (this.disable_cached_reads != that.disable_cached_reads)
        return false;
    }

    boolean this_present_disable_outermost_topn = true && this.isSetDisable_outermost_topn();
    boolean that_present_disable_outermost_topn = true && that.isSetDisable_outermost_topn();
    if (this_present_disable_outermost_topn || that_present_disable_outermost_topn) {
      if (!(this_present_disable_outermost_topn && that_present_disable_outermost_topn))
        return false;
      if (this.disable_outermost_topn != that.disable_outermost_topn)
        return false;
    }

    boolean this_present_rm_initial_mem = true && this.isSetRm_initial_mem();
    boolean that_present_rm_initial_mem = true && that.isSetRm_initial_mem();
    if (this_present_rm_initial_mem || that_present_rm_initial_mem) {
      if (!(this_present_rm_initial_mem && that_present_rm_initial_mem))
        return false;
      if (this.rm_initial_mem != that.rm_initial_mem)
        return false;
    }

    boolean this_present_query_timeout_s = true && this.isSetQuery_timeout_s();
    boolean that_present_query_timeout_s = true && that.isSetQuery_timeout_s();
    if (this_present_query_timeout_s || that_present_query_timeout_s) {
      if (!(this_present_query_timeout_s && that_present_query_timeout_s))
        return false;
      if (this.query_timeout_s != that.query_timeout_s)
        return false;
    }

    boolean this_present_max_block_mgr_memory = true && this.isSetMax_block_mgr_memory();
    boolean that_present_max_block_mgr_memory = true && that.isSetMax_block_mgr_memory();
    if (this_present_max_block_mgr_memory || that_present_max_block_mgr_memory) {
      if (!(this_present_max_block_mgr_memory && that_present_max_block_mgr_memory))
        return false;
      if (this.max_block_mgr_memory != that.max_block_mgr_memory)
        return false;
    }

    boolean this_present_appx_count_distinct = true && this.isSetAppx_count_distinct();
    boolean that_present_appx_count_distinct = true && that.isSetAppx_count_distinct();
    if (this_present_appx_count_distinct || that_present_appx_count_distinct) {
      if (!(this_present_appx_count_distinct && that_present_appx_count_distinct))
        return false;
      if (this.appx_count_distinct != that.appx_count_distinct)
        return false;
    }

    boolean this_present_disable_unsafe_spills = true && this.isSetDisable_unsafe_spills();
    boolean that_present_disable_unsafe_spills = true && that.isSetDisable_unsafe_spills();
    if (this_present_disable_unsafe_spills || that_present_disable_unsafe_spills) {
      if (!(this_present_disable_unsafe_spills && that_present_disable_unsafe_spills))
        return false;
      if (this.disable_unsafe_spills != that.disable_unsafe_spills)
        return false;
    }

    boolean this_present_seq_compression_mode = true && this.isSetSeq_compression_mode();
    boolean that_present_seq_compression_mode = true && that.isSetSeq_compression_mode();
    if (this_present_seq_compression_mode || that_present_seq_compression_mode) {
      if (!(this_present_seq_compression_mode && that_present_seq_compression_mode))
        return false;
      if (!this.seq_compression_mode.equals(that.seq_compression_mode))
        return false;
    }

    boolean this_present_exec_single_node_rows_threshold = true && this.isSetExec_single_node_rows_threshold();
    boolean that_present_exec_single_node_rows_threshold = true && that.isSetExec_single_node_rows_threshold();
    if (this_present_exec_single_node_rows_threshold || that_present_exec_single_node_rows_threshold) {
      if (!(this_present_exec_single_node_rows_threshold && that_present_exec_single_node_rows_threshold))
        return false;
      if (this.exec_single_node_rows_threshold != that.exec_single_node_rows_threshold)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    HashCodeBuilder builder = new HashCodeBuilder();

    boolean present_abort_on_error = true && (isSetAbort_on_error());
    builder.append(present_abort_on_error);
    if (present_abort_on_error)
      builder.append(abort_on_error);

    boolean present_max_errors = true && (isSetMax_errors());
    builder.append(present_max_errors);
    if (present_max_errors)
      builder.append(max_errors);

    boolean present_disable_codegen = true && (isSetDisable_codegen());
    builder.append(present_disable_codegen);
    if (present_disable_codegen)
      builder.append(disable_codegen);

    boolean present_batch_size = true && (isSetBatch_size());
    builder.append(present_batch_size);
    if (present_batch_size)
      builder.append(batch_size);

    boolean present_num_nodes = true && (isSetNum_nodes());
    builder.append(present_num_nodes);
    if (present_num_nodes)
      builder.append(num_nodes);

    boolean present_max_scan_range_length = true && (isSetMax_scan_range_length());
    builder.append(present_max_scan_range_length);
    if (present_max_scan_range_length)
      builder.append(max_scan_range_length);

    boolean present_num_scanner_threads = true && (isSetNum_scanner_threads());
    builder.append(present_num_scanner_threads);
    if (present_num_scanner_threads)
      builder.append(num_scanner_threads);

    boolean present_max_io_buffers = true && (isSetMax_io_buffers());
    builder.append(present_max_io_buffers);
    if (present_max_io_buffers)
      builder.append(max_io_buffers);

    boolean present_allow_unsupported_formats = true && (isSetAllow_unsupported_formats());
    builder.append(present_allow_unsupported_formats);
    if (present_allow_unsupported_formats)
      builder.append(allow_unsupported_formats);

    boolean present_default_order_by_limit = true && (isSetDefault_order_by_limit());
    builder.append(present_default_order_by_limit);
    if (present_default_order_by_limit)
      builder.append(default_order_by_limit);

    boolean present_debug_action = true && (isSetDebug_action());
    builder.append(present_debug_action);
    if (present_debug_action)
      builder.append(debug_action);

    boolean present_mem_limit = true && (isSetMem_limit());
    builder.append(present_mem_limit);
    if (present_mem_limit)
      builder.append(mem_limit);

    boolean present_abort_on_default_limit_exceeded = true && (isSetAbort_on_default_limit_exceeded());
    builder.append(present_abort_on_default_limit_exceeded);
    if (present_abort_on_default_limit_exceeded)
      builder.append(abort_on_default_limit_exceeded);

    boolean present_compression_codec = true && (isSetCompression_codec());
    builder.append(present_compression_codec);
    if (present_compression_codec)
      builder.append(compression_codec.getValue());

    boolean present_hbase_caching = true && (isSetHbase_caching());
    builder.append(present_hbase_caching);
    if (present_hbase_caching)
      builder.append(hbase_caching);

    boolean present_hbase_cache_blocks = true && (isSetHbase_cache_blocks());
    builder.append(present_hbase_cache_blocks);
    if (present_hbase_cache_blocks)
      builder.append(hbase_cache_blocks);

    boolean present_parquet_file_size = true && (isSetParquet_file_size());
    builder.append(present_parquet_file_size);
    if (present_parquet_file_size)
      builder.append(parquet_file_size);

    boolean present_explain_level = true && (isSetExplain_level());
    builder.append(present_explain_level);
    if (present_explain_level)
      builder.append(explain_level.getValue());

    boolean present_sync_ddl = true && (isSetSync_ddl());
    builder.append(present_sync_ddl);
    if (present_sync_ddl)
      builder.append(sync_ddl);

    boolean present_request_pool = true && (isSetRequest_pool());
    builder.append(present_request_pool);
    if (present_request_pool)
      builder.append(request_pool);

    boolean present_v_cpu_cores = true && (isSetV_cpu_cores());
    builder.append(present_v_cpu_cores);
    if (present_v_cpu_cores)
      builder.append(v_cpu_cores);

    boolean present_reservation_request_timeout = true && (isSetReservation_request_timeout());
    builder.append(present_reservation_request_timeout);
    if (present_reservation_request_timeout)
      builder.append(reservation_request_timeout);

    boolean present_disable_cached_reads = true && (isSetDisable_cached_reads());
    builder.append(present_disable_cached_reads);
    if (present_disable_cached_reads)
      builder.append(disable_cached_reads);

    boolean present_disable_outermost_topn = true && (isSetDisable_outermost_topn());
    builder.append(present_disable_outermost_topn);
    if (present_disable_outermost_topn)
      builder.append(disable_outermost_topn);

    boolean present_rm_initial_mem = true && (isSetRm_initial_mem());
    builder.append(present_rm_initial_mem);
    if (present_rm_initial_mem)
      builder.append(rm_initial_mem);

    boolean present_query_timeout_s = true && (isSetQuery_timeout_s());
    builder.append(present_query_timeout_s);
    if (present_query_timeout_s)
      builder.append(query_timeout_s);

    boolean present_max_block_mgr_memory = true && (isSetMax_block_mgr_memory());
    builder.append(present_max_block_mgr_memory);
    if (present_max_block_mgr_memory)
      builder.append(max_block_mgr_memory);

    boolean present_appx_count_distinct = true && (isSetAppx_count_distinct());
    builder.append(present_appx_count_distinct);
    if (present_appx_count_distinct)
      builder.append(appx_count_distinct);

    boolean present_disable_unsafe_spills = true && (isSetDisable_unsafe_spills());
    builder.append(present_disable_unsafe_spills);
    if (present_disable_unsafe_spills)
      builder.append(disable_unsafe_spills);

    boolean present_seq_compression_mode = true && (isSetSeq_compression_mode());
    builder.append(present_seq_compression_mode);
    if (present_seq_compression_mode)
      builder.append(seq_compression_mode.getValue());

    boolean present_exec_single_node_rows_threshold = true && (isSetExec_single_node_rows_threshold());
    builder.append(present_exec_single_node_rows_threshold);
    if (present_exec_single_node_rows_threshold)
      builder.append(exec_single_node_rows_threshold);

    return builder.toHashCode();
  }

  public int compareTo(TQueryOptions other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    TQueryOptions typedOther = (TQueryOptions)other;

    lastComparison = Boolean.valueOf(isSetAbort_on_error()).compareTo(typedOther.isSetAbort_on_error());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAbort_on_error()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.abort_on_error, typedOther.abort_on_error);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMax_errors()).compareTo(typedOther.isSetMax_errors());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMax_errors()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_errors, typedOther.max_errors);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDisable_codegen()).compareTo(typedOther.isSetDisable_codegen());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDisable_codegen()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.disable_codegen, typedOther.disable_codegen);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBatch_size()).compareTo(typedOther.isSetBatch_size());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBatch_size()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.batch_size, typedOther.batch_size);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNum_nodes()).compareTo(typedOther.isSetNum_nodes());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNum_nodes()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_nodes, typedOther.num_nodes);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMax_scan_range_length()).compareTo(typedOther.isSetMax_scan_range_length());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMax_scan_range_length()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_scan_range_length, typedOther.max_scan_range_length);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNum_scanner_threads()).compareTo(typedOther.isSetNum_scanner_threads());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNum_scanner_threads()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.num_scanner_threads, typedOther.num_scanner_threads);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMax_io_buffers()).compareTo(typedOther.isSetMax_io_buffers());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMax_io_buffers()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_io_buffers, typedOther.max_io_buffers);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAllow_unsupported_formats()).compareTo(typedOther.isSetAllow_unsupported_formats());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAllow_unsupported_formats()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.allow_unsupported_formats, typedOther.allow_unsupported_formats);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDefault_order_by_limit()).compareTo(typedOther.isSetDefault_order_by_limit());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDefault_order_by_limit()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.default_order_by_limit, typedOther.default_order_by_limit);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDebug_action()).compareTo(typedOther.isSetDebug_action());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDebug_action()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.debug_action, typedOther.debug_action);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMem_limit()).compareTo(typedOther.isSetMem_limit());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMem_limit()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mem_limit, typedOther.mem_limit);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAbort_on_default_limit_exceeded()).compareTo(typedOther.isSetAbort_on_default_limit_exceeded());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAbort_on_default_limit_exceeded()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.abort_on_default_limit_exceeded, typedOther.abort_on_default_limit_exceeded);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCompression_codec()).compareTo(typedOther.isSetCompression_codec());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCompression_codec()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.compression_codec, typedOther.compression_codec);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetHbase_caching()).compareTo(typedOther.isSetHbase_caching());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHbase_caching()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hbase_caching, typedOther.hbase_caching);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetHbase_cache_blocks()).compareTo(typedOther.isSetHbase_cache_blocks());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHbase_cache_blocks()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hbase_cache_blocks, typedOther.hbase_cache_blocks);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetParquet_file_size()).compareTo(typedOther.isSetParquet_file_size());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetParquet_file_size()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parquet_file_size, typedOther.parquet_file_size);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetExplain_level()).compareTo(typedOther.isSetExplain_level());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExplain_level()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.explain_level, typedOther.explain_level);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSync_ddl()).compareTo(typedOther.isSetSync_ddl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSync_ddl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sync_ddl, typedOther.sync_ddl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRequest_pool()).compareTo(typedOther.isSetRequest_pool());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRequest_pool()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.request_pool, typedOther.request_pool);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetV_cpu_cores()).compareTo(typedOther.isSetV_cpu_cores());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetV_cpu_cores()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.v_cpu_cores, typedOther.v_cpu_cores);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetReservation_request_timeout()).compareTo(typedOther.isSetReservation_request_timeout());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReservation_request_timeout()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reservation_request_timeout, typedOther.reservation_request_timeout);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDisable_cached_reads()).compareTo(typedOther.isSetDisable_cached_reads());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDisable_cached_reads()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.disable_cached_reads, typedOther.disable_cached_reads);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDisable_outermost_topn()).compareTo(typedOther.isSetDisable_outermost_topn());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDisable_outermost_topn()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.disable_outermost_topn, typedOther.disable_outermost_topn);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRm_initial_mem()).compareTo(typedOther.isSetRm_initial_mem());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRm_initial_mem()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rm_initial_mem, typedOther.rm_initial_mem);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetQuery_timeout_s()).compareTo(typedOther.isSetQuery_timeout_s());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQuery_timeout_s()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.query_timeout_s, typedOther.query_timeout_s);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetMax_block_mgr_memory()).compareTo(typedOther.isSetMax_block_mgr_memory());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMax_block_mgr_memory()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.max_block_mgr_memory, typedOther.max_block_mgr_memory);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAppx_count_distinct()).compareTo(typedOther.isSetAppx_count_distinct());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAppx_count_distinct()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.appx_count_distinct, typedOther.appx_count_distinct);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDisable_unsafe_spills()).compareTo(typedOther.isSetDisable_unsafe_spills());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDisable_unsafe_spills()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.disable_unsafe_spills, typedOther.disable_unsafe_spills);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSeq_compression_mode()).compareTo(typedOther.isSetSeq_compression_mode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSeq_compression_mode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.seq_compression_mode, typedOther.seq_compression_mode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetExec_single_node_rows_threshold()).compareTo(typedOther.isSetExec_single_node_rows_threshold());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetExec_single_node_rows_threshold()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.exec_single_node_rows_threshold, typedOther.exec_single_node_rows_threshold);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("TQueryOptions(");
    boolean first = true;

    if (isSetAbort_on_error()) {
      sb.append("abort_on_error:");
      sb.append(this.abort_on_error);
      first = false;
    }
    if (isSetMax_errors()) {
      if (!first) sb.append(", ");
      sb.append("max_errors:");
      sb.append(this.max_errors);
      first = false;
    }
    if (isSetDisable_codegen()) {
      if (!first) sb.append(", ");
      sb.append("disable_codegen:");
      sb.append(this.disable_codegen);
      first = false;
    }
    if (isSetBatch_size()) {
      if (!first) sb.append(", ");
      sb.append("batch_size:");
      sb.append(this.batch_size);
      first = false;
    }
    if (isSetNum_nodes()) {
      if (!first) sb.append(", ");
      sb.append("num_nodes:");
      sb.append(this.num_nodes);
      first = false;
    }
    if (isSetMax_scan_range_length()) {
      if (!first) sb.append(", ");
      sb.append("max_scan_range_length:");
      sb.append(this.max_scan_range_length);
      first = false;
    }
    if (isSetNum_scanner_threads()) {
      if (!first) sb.append(", ");
      sb.append("num_scanner_threads:");
      sb.append(this.num_scanner_threads);
      first = false;
    }
    if (isSetMax_io_buffers()) {
      if (!first) sb.append(", ");
      sb.append("max_io_buffers:");
      sb.append(this.max_io_buffers);
      first = false;
    }
    if (isSetAllow_unsupported_formats()) {
      if (!first) sb.append(", ");
      sb.append("allow_unsupported_formats:");
      sb.append(this.allow_unsupported_formats);
      first = false;
    }
    if (isSetDefault_order_by_limit()) {
      if (!first) sb.append(", ");
      sb.append("default_order_by_limit:");
      sb.append(this.default_order_by_limit);
      first = false;
    }
    if (isSetDebug_action()) {
      if (!first) sb.append(", ");
      sb.append("debug_action:");
      if (this.debug_action == null) {
        sb.append("null");
      } else {
        sb.append(this.debug_action);
      }
      first = false;
    }
    if (isSetMem_limit()) {
      if (!first) sb.append(", ");
      sb.append("mem_limit:");
      sb.append(this.mem_limit);
      first = false;
    }
    if (isSetAbort_on_default_limit_exceeded()) {
      if (!first) sb.append(", ");
      sb.append("abort_on_default_limit_exceeded:");
      sb.append(this.abort_on_default_limit_exceeded);
      first = false;
    }
    if (isSetCompression_codec()) {
      if (!first) sb.append(", ");
      sb.append("compression_codec:");
      if (this.compression_codec == null) {
        sb.append("null");
      } else {
        sb.append(this.compression_codec);
      }
      first = false;
    }
    if (isSetHbase_caching()) {
      if (!first) sb.append(", ");
      sb.append("hbase_caching:");
      sb.append(this.hbase_caching);
      first = false;
    }
    if (isSetHbase_cache_blocks()) {
      if (!first) sb.append(", ");
      sb.append("hbase_cache_blocks:");
      sb.append(this.hbase_cache_blocks);
      first = false;
    }
    if (isSetParquet_file_size()) {
      if (!first) sb.append(", ");
      sb.append("parquet_file_size:");
      sb.append(this.parquet_file_size);
      first = false;
    }
    if (isSetExplain_level()) {
      if (!first) sb.append(", ");
      sb.append("explain_level:");
      if (this.explain_level == null) {
        sb.append("null");
      } else {
        sb.append(this.explain_level);
      }
      first = false;
    }
    if (isSetSync_ddl()) {
      if (!first) sb.append(", ");
      sb.append("sync_ddl:");
      sb.append(this.sync_ddl);
      first = false;
    }
    if (isSetRequest_pool()) {
      if (!first) sb.append(", ");
      sb.append("request_pool:");
      if (this.request_pool == null) {
        sb.append("null");
      } else {
        sb.append(this.request_pool);
      }
      first = false;
    }
    if (isSetV_cpu_cores()) {
      if (!first) sb.append(", ");
      sb.append("v_cpu_cores:");
      sb.append(this.v_cpu_cores);
      first = false;
    }
    if (isSetReservation_request_timeout()) {
      if (!first) sb.append(", ");
      sb.append("reservation_request_timeout:");
      sb.append(this.reservation_request_timeout);
      first = false;
    }
    if (isSetDisable_cached_reads()) {
      if (!first) sb.append(", ");
      sb.append("disable_cached_reads:");
      sb.append(this.disable_cached_reads);
      first = false;
    }
    if (isSetDisable_outermost_topn()) {
      if (!first) sb.append(", ");
      sb.append("disable_outermost_topn:");
      sb.append(this.disable_outermost_topn);
      first = false;
    }
    if (isSetRm_initial_mem()) {
      if (!first) sb.append(", ");
      sb.append("rm_initial_mem:");
      sb.append(this.rm_initial_mem);
      first = false;
    }
    if (isSetQuery_timeout_s()) {
      if (!first) sb.append(", ");
      sb.append("query_timeout_s:");
      sb.append(this.query_timeout_s);
      first = false;
    }
    if (isSetMax_block_mgr_memory()) {
      if (!first) sb.append(", ");
      sb.append("max_block_mgr_memory:");
      sb.append(this.max_block_mgr_memory);
      first = false;
    }
    if (isSetAppx_count_distinct()) {
      if (!first) sb.append(", ");
      sb.append("appx_count_distinct:");
      sb.append(this.appx_count_distinct);
      first = false;
    }
    if (isSetDisable_unsafe_spills()) {
      if (!first) sb.append(", ");
      sb.append("disable_unsafe_spills:");
      sb.append(this.disable_unsafe_spills);
      first = false;
    }
    if (isSetSeq_compression_mode()) {
      if (!first) sb.append(", ");
      sb.append("seq_compression_mode:");
      if (this.seq_compression_mode == null) {
        sb.append("null");
      } else {
        sb.append(this.seq_compression_mode);
      }
      first = false;
    }
    if (isSetExec_single_node_rows_threshold()) {
      if (!first) sb.append(", ");
      sb.append("exec_single_node_rows_threshold:");
      sb.append(this.exec_single_node_rows_threshold);
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
  }

  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);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class TQueryOptionsStandardSchemeFactory implements SchemeFactory {
    public TQueryOptionsStandardScheme getScheme() {
      return new TQueryOptionsStandardScheme();
    }
  }

  private static class TQueryOptionsStandardScheme extends StandardScheme<TQueryOptions> {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TQueryOptions struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // ABORT_ON_ERROR
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.abort_on_error = iprot.readBool();
              struct.setAbort_on_errorIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // MAX_ERRORS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.max_errors = iprot.readI32();
              struct.setMax_errorsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // DISABLE_CODEGEN
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.disable_codegen = iprot.readBool();
              struct.setDisable_codegenIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // BATCH_SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.batch_size = iprot.readI32();
              struct.setBatch_sizeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // NUM_NODES
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.num_nodes = iprot.readI32();
              struct.setNum_nodesIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // MAX_SCAN_RANGE_LENGTH
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.max_scan_range_length = iprot.readI64();
              struct.setMax_scan_range_lengthIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // NUM_SCANNER_THREADS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.num_scanner_threads = iprot.readI32();
              struct.setNum_scanner_threadsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // MAX_IO_BUFFERS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.max_io_buffers = iprot.readI32();
              struct.setMax_io_buffersIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // ALLOW_UNSUPPORTED_FORMATS
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.allow_unsupported_formats = iprot.readBool();
              struct.setAllow_unsupported_formatsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // DEFAULT_ORDER_BY_LIMIT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.default_order_by_limit = iprot.readI64();
              struct.setDefault_order_by_limitIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // DEBUG_ACTION
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.debug_action = iprot.readString();
              struct.setDebug_actionIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // MEM_LIMIT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.mem_limit = iprot.readI64();
              struct.setMem_limitIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // ABORT_ON_DEFAULT_LIMIT_EXCEEDED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.abort_on_default_limit_exceeded = iprot.readBool();
              struct.setAbort_on_default_limit_exceededIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 14: // COMPRESSION_CODEC
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.compression_codec = com.cloudera.impala.thrift.THdfsCompression.findByValue(iprot.readI32());
              struct.setCompression_codecIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 15: // HBASE_CACHING
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.hbase_caching = iprot.readI32();
              struct.setHbase_cachingIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 16: // HBASE_CACHE_BLOCKS
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.hbase_cache_blocks = iprot.readBool();
              struct.setHbase_cache_blocksIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 17: // PARQUET_FILE_SIZE
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.parquet_file_size = iprot.readI64();
              struct.setParquet_file_sizeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 18: // EXPLAIN_LEVEL
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.explain_level = com.cloudera.impala.thrift.TExplainLevel.findByValue(iprot.readI32());
              struct.setExplain_levelIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 19: // SYNC_DDL
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.sync_ddl = iprot.readBool();
              struct.setSync_ddlIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // REQUEST_POOL
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.request_pool = iprot.readString();
              struct.setRequest_poolIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 21: // V_CPU_CORES
            if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
              struct.v_cpu_cores = iprot.readI16();
              struct.setV_cpu_coresIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 22: // RESERVATION_REQUEST_TIMEOUT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.reservation_request_timeout = iprot.readI64();
              struct.setReservation_request_timeoutIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 23: // DISABLE_CACHED_READS
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.disable_cached_reads = iprot.readBool();
              struct.setDisable_cached_readsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 24: // DISABLE_OUTERMOST_TOPN
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.disable_outermost_topn = iprot.readBool();
              struct.setDisable_outermost_topnIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 25: // RM_INITIAL_MEM
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.rm_initial_mem = iprot.readI64();
              struct.setRm_initial_memIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 26: // QUERY_TIMEOUT_S
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.query_timeout_s = iprot.readI32();
              struct.setQuery_timeout_sIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 27: // MAX_BLOCK_MGR_MEMORY
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.max_block_mgr_memory = iprot.readI64();
              struct.setMax_block_mgr_memoryIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 28: // APPX_COUNT_DISTINCT
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.appx_count_distinct = iprot.readBool();
              struct.setAppx_count_distinctIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 29: // DISABLE_UNSAFE_SPILLS
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.disable_unsafe_spills = iprot.readBool();
              struct.setDisable_unsafe_spillsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // SEQ_COMPRESSION_MODE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.seq_compression_mode = com.cloudera.impala.thrift.THdfsSeqCompressionMode.findByValue(iprot.readI32());
              struct.setSeq_compression_modeIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 31: // EXEC_SINGLE_NODE_ROWS_THRESHOLD
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.exec_single_node_rows_threshold = iprot.readI32();
              struct.setExec_single_node_rows_thresholdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TQueryOptions struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetAbort_on_error()) {
        oprot.writeFieldBegin(ABORT_ON_ERROR_FIELD_DESC);
        oprot.writeBool(struct.abort_on_error);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMax_errors()) {
        oprot.writeFieldBegin(MAX_ERRORS_FIELD_DESC);
        oprot.writeI32(struct.max_errors);
        oprot.writeFieldEnd();
      }
      if (struct.isSetDisable_codegen()) {
        oprot.writeFieldBegin(DISABLE_CODEGEN_FIELD_DESC);
        oprot.writeBool(struct.disable_codegen);
        oprot.writeFieldEnd();
      }
      if (struct.isSetBatch_size()) {
        oprot.writeFieldBegin(BATCH_SIZE_FIELD_DESC);
        oprot.writeI32(struct.batch_size);
        oprot.writeFieldEnd();
      }
      if (struct.isSetNum_nodes()) {
        oprot.writeFieldBegin(NUM_NODES_FIELD_DESC);
        oprot.writeI32(struct.num_nodes);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMax_scan_range_length()) {
        oprot.writeFieldBegin(MAX_SCAN_RANGE_LENGTH_FIELD_DESC);
        oprot.writeI64(struct.max_scan_range_length);
        oprot.writeFieldEnd();
      }
      if (struct.isSetNum_scanner_threads()) {
        oprot.writeFieldBegin(NUM_SCANNER_THREADS_FIELD_DESC);
        oprot.writeI32(struct.num_scanner_threads);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMax_io_buffers()) {
        oprot.writeFieldBegin(MAX_IO_BUFFERS_FIELD_DESC);
        oprot.writeI32(struct.max_io_buffers);
        oprot.writeFieldEnd();
      }
      if (struct.isSetAllow_unsupported_formats()) {
        oprot.writeFieldBegin(ALLOW_UNSUPPORTED_FORMATS_FIELD_DESC);
        oprot.writeBool(struct.allow_unsupported_formats);
        oprot.writeFieldEnd();
      }
      if (struct.isSetDefault_order_by_limit()) {
        oprot.writeFieldBegin(DEFAULT_ORDER_BY_LIMIT_FIELD_DESC);
        oprot.writeI64(struct.default_order_by_limit);
        oprot.writeFieldEnd();
      }
      if (struct.debug_action != null) {
        if (struct.isSetDebug_action()) {
          oprot.writeFieldBegin(DEBUG_ACTION_FIELD_DESC);
          oprot.writeString(struct.debug_action);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetMem_limit()) {
        oprot.writeFieldBegin(MEM_LIMIT_FIELD_DESC);
        oprot.writeI64(struct.mem_limit);
        oprot.writeFieldEnd();
      }
      if (struct.isSetAbort_on_default_limit_exceeded()) {
        oprot.writeFieldBegin(ABORT_ON_DEFAULT_LIMIT_EXCEEDED_FIELD_DESC);
        oprot.writeBool(struct.abort_on_default_limit_exceeded);
        oprot.writeFieldEnd();
      }
      if (struct.compression_codec != null) {
        if (struct.isSetCompression_codec()) {
          oprot.writeFieldBegin(COMPRESSION_CODEC_FIELD_DESC);
          oprot.writeI32(struct.compression_codec.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetHbase_caching()) {
        oprot.writeFieldBegin(HBASE_CACHING_FIELD_DESC);
        oprot.writeI32(struct.hbase_caching);
        oprot.writeFieldEnd();
      }
      if (struct.isSetHbase_cache_blocks()) {
        oprot.writeFieldBegin(HBASE_CACHE_BLOCKS_FIELD_DESC);
        oprot.writeBool(struct.hbase_cache_blocks);
        oprot.writeFieldEnd();
      }
      if (struct.isSetParquet_file_size()) {
        oprot.writeFieldBegin(PARQUET_FILE_SIZE_FIELD_DESC);
        oprot.writeI64(struct.parquet_file_size);
        oprot.writeFieldEnd();
      }
      if (struct.explain_level != null) {
        if (struct.isSetExplain_level()) {
          oprot.writeFieldBegin(EXPLAIN_LEVEL_FIELD_DESC);
          oprot.writeI32(struct.explain_level.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetSync_ddl()) {
        oprot.writeFieldBegin(SYNC_DDL_FIELD_DESC);
        oprot.writeBool(struct.sync_ddl);
        oprot.writeFieldEnd();
      }
      if (struct.request_pool != null) {
        if (struct.isSetRequest_pool()) {
          oprot.writeFieldBegin(REQUEST_POOL_FIELD_DESC);
          oprot.writeString(struct.request_pool);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetV_cpu_cores()) {
        oprot.writeFieldBegin(V_CPU_CORES_FIELD_DESC);
        oprot.writeI16(struct.v_cpu_cores);
        oprot.writeFieldEnd();
      }
      if (struct.isSetReservation_request_timeout()) {
        oprot.writeFieldBegin(RESERVATION_REQUEST_TIMEOUT_FIELD_DESC);
        oprot.writeI64(struct.reservation_request_timeout);
        oprot.writeFieldEnd();
      }
      if (struct.isSetDisable_cached_reads()) {
        oprot.writeFieldBegin(DISABLE_CACHED_READS_FIELD_DESC);
        oprot.writeBool(struct.disable_cached_reads);
        oprot.writeFieldEnd();
      }
      if (struct.isSetDisable_outermost_topn()) {
        oprot.writeFieldBegin(DISABLE_OUTERMOST_TOPN_FIELD_DESC);
        oprot.writeBool(struct.disable_outermost_topn);
        oprot.writeFieldEnd();
      }
      if (struct.isSetRm_initial_mem()) {
        oprot.writeFieldBegin(RM_INITIAL_MEM_FIELD_DESC);
        oprot.writeI64(struct.rm_initial_mem);
        oprot.writeFieldEnd();
      }
      if (struct.isSetQuery_timeout_s()) {
        oprot.writeFieldBegin(QUERY_TIMEOUT_S_FIELD_DESC);
        oprot.writeI32(struct.query_timeout_s);
        oprot.writeFieldEnd();
      }
      if (struct.isSetMax_block_mgr_memory()) {
        oprot.writeFieldBegin(MAX_BLOCK_MGR_MEMORY_FIELD_DESC);
        oprot.writeI64(struct.max_block_mgr_memory);
        oprot.writeFieldEnd();
      }
      if (struct.isSetAppx_count_distinct()) {
        oprot.writeFieldBegin(APPX_COUNT_DISTINCT_FIELD_DESC);
        oprot.writeBool(struct.appx_count_distinct);
        oprot.writeFieldEnd();
      }
      if (struct.isSetDisable_unsafe_spills()) {
        oprot.writeFieldBegin(DISABLE_UNSAFE_SPILLS_FIELD_DESC);
        oprot.writeBool(struct.disable_unsafe_spills);
        oprot.writeFieldEnd();
      }
      if (struct.seq_compression_mode != null) {
        if (struct.isSetSeq_compression_mode()) {
          oprot.writeFieldBegin(SEQ_COMPRESSION_MODE_FIELD_DESC);
          oprot.writeI32(struct.seq_compression_mode.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetExec_single_node_rows_threshold()) {
        oprot.writeFieldBegin(EXEC_SINGLE_NODE_ROWS_THRESHOLD_FIELD_DESC);
        oprot.writeI32(struct.exec_single_node_rows_threshold);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TQueryOptionsTupleSchemeFactory implements SchemeFactory {
    public TQueryOptionsTupleScheme getScheme() {
      return new TQueryOptionsTupleScheme();
    }
  }

  private static class TQueryOptionsTupleScheme extends TupleScheme<TQueryOptions> {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TQueryOptions struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetAbort_on_error()) {
        optionals.set(0);
      }
      if (struct.isSetMax_errors()) {
        optionals.set(1);
      }
      if (struct.isSetDisable_codegen()) {
        optionals.set(2);
      }
      if (struct.isSetBatch_size()) {
        optionals.set(3);
      }
      if (struct.isSetNum_nodes()) {
        optionals.set(4);
      }
      if (struct.isSetMax_scan_range_length()) {
        optionals.set(5);
      }
      if (struct.isSetNum_scanner_threads()) {
        optionals.set(6);
      }
      if (struct.isSetMax_io_buffers()) {
        optionals.set(7);
      }
      if (struct.isSetAllow_unsupported_formats()) {
        optionals.set(8);
      }
      if (struct.isSetDefault_order_by_limit()) {
        optionals.set(9);
      }
      if (struct.isSetDebug_action()) {
        optionals.set(10);
      }
      if (struct.isSetMem_limit()) {
        optionals.set(11);
      }
      if (struct.isSetAbort_on_default_limit_exceeded()) {
        optionals.set(12);
      }
      if (struct.isSetCompression_codec()) {
        optionals.set(13);
      }
      if (struct.isSetHbase_caching()) {
        optionals.set(14);
      }
      if (struct.isSetHbase_cache_blocks()) {
        optionals.set(15);
      }
      if (struct.isSetParquet_file_size()) {
        optionals.set(16);
      }
      if (struct.isSetExplain_level()) {
        optionals.set(17);
      }
      if (struct.isSetSync_ddl()) {
        optionals.set(18);
      }
      if (struct.isSetRequest_pool()) {
        optionals.set(19);
      }
      if (struct.isSetV_cpu_cores()) {
        optionals.set(20);
      }
      if (struct.isSetReservation_request_timeout()) {
        optionals.set(21);
      }
      if (struct.isSetDisable_cached_reads()) {
        optionals.set(22);
      }
      if (struct.isSetDisable_outermost_topn()) {
        optionals.set(23);
      }
      if (struct.isSetRm_initial_mem()) {
        optionals.set(24);
      }
      if (struct.isSetQuery_timeout_s()) {
        optionals.set(25);
      }
      if (struct.isSetMax_block_mgr_memory()) {
        optionals.set(26);
      }
      if (struct.isSetAppx_count_distinct()) {
        optionals.set(27);
      }
      if (struct.isSetDisable_unsafe_spills()) {
        optionals.set(28);
      }
      if (struct.isSetSeq_compression_mode()) {
        optionals.set(29);
      }
      if (struct.isSetExec_single_node_rows_threshold()) {
        optionals.set(30);
      }
      oprot.writeBitSet(optionals, 31);
      if (struct.isSetAbort_on_error()) {
        oprot.writeBool(struct.abort_on_error);
      }
      if (struct.isSetMax_errors()) {
        oprot.writeI32(struct.max_errors);
      }
      if (struct.isSetDisable_codegen()) {
        oprot.writeBool(struct.disable_codegen);
      }
      if (struct.isSetBatch_size()) {
        oprot.writeI32(struct.batch_size);
      }
      if (struct.isSetNum_nodes()) {
        oprot.writeI32(struct.num_nodes);
      }
      if (struct.isSetMax_scan_range_length()) {
        oprot.writeI64(struct.max_scan_range_length);
      }
      if (struct.isSetNum_scanner_threads()) {
        oprot.writeI32(struct.num_scanner_threads);
      }
      if (struct.isSetMax_io_buffers()) {
        oprot.writeI32(struct.max_io_buffers);
      }
      if (struct.isSetAllow_unsupported_formats()) {
        oprot.writeBool(struct.allow_unsupported_formats);
      }
      if (struct.isSetDefault_order_by_limit()) {
        oprot.writeI64(struct.default_order_by_limit);
      }
      if (struct.isSetDebug_action()) {
        oprot.writeString(struct.debug_action);
      }
      if (struct.isSetMem_limit()) {
        oprot.writeI64(struct.mem_limit);
      }
      if (struct.isSetAbort_on_default_limit_exceeded()) {
        oprot.writeBool(struct.abort_on_default_limit_exceeded);
      }
      if (struct.isSetCompression_codec()) {
        oprot.writeI32(struct.compression_codec.getValue());
      }
      if (struct.isSetHbase_caching()) {
        oprot.writeI32(struct.hbase_caching);
      }
      if (struct.isSetHbase_cache_blocks()) {
        oprot.writeBool(struct.hbase_cache_blocks);
      }
      if (struct.isSetParquet_file_size()) {
        oprot.writeI64(struct.parquet_file_size);
      }
      if (struct.isSetExplain_level()) {
        oprot.writeI32(struct.explain_level.getValue());
      }
      if (struct.isSetSync_ddl()) {
        oprot.writeBool(struct.sync_ddl);
      }
      if (struct.isSetRequest_pool()) {
        oprot.writeString(struct.request_pool);
      }
      if (struct.isSetV_cpu_cores()) {
        oprot.writeI16(struct.v_cpu_cores);
      }
      if (struct.isSetReservation_request_timeout()) {
        oprot.writeI64(struct.reservation_request_timeout);
      }
      if (struct.isSetDisable_cached_reads()) {
        oprot.writeBool(struct.disable_cached_reads);
      }
      if (struct.isSetDisable_outermost_topn()) {
        oprot.writeBool(struct.disable_outermost_topn);
      }
      if (struct.isSetRm_initial_mem()) {
        oprot.writeI64(struct.rm_initial_mem);
      }
      if (struct.isSetQuery_timeout_s()) {
        oprot.writeI32(struct.query_timeout_s);
      }
      if (struct.isSetMax_block_mgr_memory()) {
        oprot.writeI64(struct.max_block_mgr_memory);
      }
      if (struct.isSetAppx_count_distinct()) {
        oprot.writeBool(struct.appx_count_distinct);
      }
      if (struct.isSetDisable_unsafe_spills()) {
        oprot.writeBool(struct.disable_unsafe_spills);
      }
      if (struct.isSetSeq_compression_mode()) {
        oprot.writeI32(struct.seq_compression_mode.getValue());
      }
      if (struct.isSetExec_single_node_rows_threshold()) {
        oprot.writeI32(struct.exec_single_node_rows_threshold);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TQueryOptions struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(31);
      if (incoming.get(0)) {
        struct.abort_on_error = iprot.readBool();
        struct.setAbort_on_errorIsSet(true);
      }
      if (incoming.get(1)) {
        struct.max_errors = iprot.readI32();
        struct.setMax_errorsIsSet(true);
      }
      if (incoming.get(2)) {
        struct.disable_codegen = iprot.readBool();
        struct.setDisable_codegenIsSet(true);
      }
      if (incoming.get(3)) {
        struct.batch_size = iprot.readI32();
        struct.setBatch_sizeIsSet(true);
      }
      if (incoming.get(4)) {
        struct.num_nodes = iprot.readI32();
        struct.setNum_nodesIsSet(true);
      }
      if (incoming.get(5)) {
        struct.max_scan_range_length = iprot.readI64();
        struct.setMax_scan_range_lengthIsSet(true);
      }
      if (incoming.get(6)) {
        struct.num_scanner_threads = iprot.readI32();
        struct.setNum_scanner_threadsIsSet(true);
      }
      if (incoming.get(7)) {
        struct.max_io_buffers = iprot.readI32();
        struct.setMax_io_buffersIsSet(true);
      }
      if (incoming.get(8)) {
        struct.allow_unsupported_formats = iprot.readBool();
        struct.setAllow_unsupported_formatsIsSet(true);
      }
      if (incoming.get(9)) {
        struct.default_order_by_limit = iprot.readI64();
        struct.setDefault_order_by_limitIsSet(true);
      }
      if (incoming.get(10)) {
        struct.debug_action = iprot.readString();
        struct.setDebug_actionIsSet(true);
      }
      if (incoming.get(11)) {
        struct.mem_limit = iprot.readI64();
        struct.setMem_limitIsSet(true);
      }
      if (incoming.get(12)) {
        struct.abort_on_default_limit_exceeded = iprot.readBool();
        struct.setAbort_on_default_limit_exceededIsSet(true);
      }
      if (incoming.get(13)) {
        struct.compression_codec = com.cloudera.impala.thrift.THdfsCompression.findByValue(iprot.readI32());
        struct.setCompression_codecIsSet(true);
      }
      if (incoming.get(14)) {
        struct.hbase_caching = iprot.readI32();
        struct.setHbase_cachingIsSet(true);
      }
      if (incoming.get(15)) {
        struct.hbase_cache_blocks = iprot.readBool();
        struct.setHbase_cache_blocksIsSet(true);
      }
      if (incoming.get(16)) {
        struct.parquet_file_size = iprot.readI64();
        struct.setParquet_file_sizeIsSet(true);
      }
      if (incoming.get(17)) {
        struct.explain_level = com.cloudera.impala.thrift.TExplainLevel.findByValue(iprot.readI32());
        struct.setExplain_levelIsSet(true);
      }
      if (incoming.get(18)) {
        struct.sync_ddl = iprot.readBool();
        struct.setSync_ddlIsSet(true);
      }
      if (incoming.get(19)) {
        struct.request_pool = iprot.readString();
        struct.setRequest_poolIsSet(true);
      }
      if (incoming.get(20)) {
        struct.v_cpu_cores = iprot.readI16();
        struct.setV_cpu_coresIsSet(true);
      }
      if (incoming.get(21)) {
        struct.reservation_request_timeout = iprot.readI64();
        struct.setReservation_request_timeoutIsSet(true);
      }
      if (incoming.get(22)) {
        struct.disable_cached_reads = iprot.readBool();
        struct.setDisable_cached_readsIsSet(true);
      }
      if (incoming.get(23)) {
        struct.disable_outermost_topn = iprot.readBool();
        struct.setDisable_outermost_topnIsSet(true);
      }
      if (incoming.get(24)) {
        struct.rm_initial_mem = iprot.readI64();
        struct.setRm_initial_memIsSet(true);
      }
      if (incoming.get(25)) {
        struct.query_timeout_s = iprot.readI32();
        struct.setQuery_timeout_sIsSet(true);
      }
      if (incoming.get(26)) {
        struct.max_block_mgr_memory = iprot.readI64();
        struct.setMax_block_mgr_memoryIsSet(true);
      }
      if (incoming.get(27)) {
        struct.appx_count_distinct = iprot.readBool();
        struct.setAppx_count_distinctIsSet(true);
      }
      if (incoming.get(28)) {
        struct.disable_unsafe_spills = iprot.readBool();
        struct.setDisable_unsafe_spillsIsSet(true);
      }
      if (incoming.get(29)) {
        struct.seq_compression_mode = com.cloudera.impala.thrift.THdfsSeqCompressionMode.findByValue(iprot.readI32());
        struct.setSeq_compression_modeIsSet(true);
      }
      if (incoming.get(30)) {
        struct.exec_single_node_rows_threshold = iprot.readI32();
        struct.setExec_single_node_rows_thresholdIsSet(true);
      }
    }
  }

}

