hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r1554989 [6/6] - in /hive/trunk: itests/hive-unit/src/test/java/org/apache/hive/jdbc/miniHS2/ jdbc/src/java/org/apache/hive/jdbc/ ql/src/java/org/apache/hadoop/hive/ql/exec/ serde/src/java/org/apache/hadoop/hive/serde2/ service/if/ service/...
Date Fri, 03 Jan 2014 01:34:10 GMT
Added: hive/trunk/service/src/java/org/apache/hive/service/cli/ColumnBasedSet.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/ColumnBasedSet.java?rev=1554989&view=auto
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/ColumnBasedSet.java (added)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/ColumnBasedSet.java Fri Jan  3 01:34:08 2014
@@ -0,0 +1,149 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hive.service.cli;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.hive.service.cli.thrift.TColumn;
+import org.apache.hive.service.cli.thrift.TRow;
+import org.apache.hive.service.cli.thrift.TRowSet;
+
+/**
+ * ColumnBasedSet.
+ */
+public class ColumnBasedSet implements RowSet {
+
+  private long startOffset;
+
+  private final Type[] types; // non-null only for writing (server-side)
+  private final List<Column> columns;
+
+  public ColumnBasedSet(TableSchema schema) {
+    types = schema.toTypes();
+    columns = new ArrayList<Column>();
+    for (ColumnDescriptor colDesc : schema.getColumnDescriptors()) {
+      columns.add(new Column(colDesc.getType()));
+    }
+  }
+
+  public ColumnBasedSet(TRowSet tRowSet) {
+    types = null;
+    columns = new ArrayList<Column>();
+    for (TColumn tvalue : tRowSet.getColumns()) {
+      columns.add(new Column(tvalue));
+    }
+    startOffset = tRowSet.getStartRowOffset();
+  }
+
+  private ColumnBasedSet(Type[] types, List<Column> columns, long startOffset) {
+    this.types = types;
+    this.columns = columns;
+    this.startOffset = startOffset;
+  }
+
+  @Override
+  public ColumnBasedSet addRow(Object[] fields) {
+    for (int i = 0; i < fields.length; i++) {
+      columns.get(i).addValue(types[i], fields[i]);
+    }
+    return this;
+  }
+
+  public List<Column> getColumns() {
+    return columns;
+  }
+
+  @Override
+  public int numColumns() {
+    return columns.size();
+  }
+
+  @Override
+  public int numRows() {
+    return columns.isEmpty() ? 0 : columns.get(0).size();
+  }
+
+  @Override
+  public ColumnBasedSet extractSubset(int maxRows) {
+    int numRows = Math.min(numRows(), maxRows);
+
+    List<Column> subset = new ArrayList<Column>();
+    for (int i = 0; i < columns.size(); i++) {
+      subset.add(columns.get(i).extractSubset(0, numRows));
+    }
+    ColumnBasedSet result = new ColumnBasedSet(types, subset, startOffset);
+    startOffset += numRows;
+    return result;
+  }
+
+  @Override
+  public long getStartOffset() {
+    return startOffset;
+  }
+
+  @Override
+  public void setStartOffset(long startOffset) {
+    this.startOffset = startOffset;
+  }
+
+  public TRowSet toTRowSet() {
+    TRowSet tRowSet = new TRowSet(startOffset, new ArrayList<TRow>());
+    for (int i = 0; i < columns.size(); i++) {
+      tRowSet.addToColumns(columns.get(i).toTColumn());
+    }
+    return tRowSet;
+  }
+
+  @Override
+  public Iterator<Object[]> iterator() {
+    return new Iterator<Object[]>() {
+
+      private int index;
+      private final Object[] convey = new Object[numColumns()];
+
+      @Override
+      public boolean hasNext() {
+        return index < numRows();
+      }
+
+      @Override
+      public Object[] next() {
+        for (int i = 0; i < columns.size(); i++) {
+          convey[i] = columns.get(i).get(index);
+        }
+        index++;
+        return convey;
+      }
+
+      @Override
+      public void remove() {
+        throw new UnsupportedOperationException("remove");
+      }
+    };
+  }
+
+  public Object[] fill(int index, Object[] convey) {
+    for (int i = 0; i < columns.size(); i++) {
+      convey[i] = columns.get(i).get(index);
+    }
+    return convey;
+  }
+}

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/ColumnValue.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/ColumnValue.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/ColumnValue.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/ColumnValue.java Fri Jan  3 01:34:08 2014
@@ -18,6 +18,7 @@
 
 package org.apache.hive.service.cli;
 
+import java.math.BigDecimal;
 import java.sql.Date;
 import java.sql.Timestamp;
 
@@ -34,133 +35,116 @@ import org.apache.hive.service.cli.thrif
 import org.apache.hive.service.cli.thrift.TStringValue;
 
 /**
- * ColumnValue.
+ * Protocols before HIVE_CLI_SERVICE_PROTOCOL_V6 (used by RowBasedSet)
  *
  */
 public class ColumnValue {
 
-  public static final TColumnValue NULL = new TColumnValue();
-
-  static {
-    NULL.setStringVal(new TStringValue());
-  }
-
-  // TODO: replace this with a non-Thrift implementation
-  private final TColumnValue tColumnValue;
-
-  public ColumnValue(TColumnValue tColumnValue) {
-    this.tColumnValue = new TColumnValue(tColumnValue);
-  }
-
-  private static boolean isNull(Object value) {
-    return (value == null);
-  }
-
-  public static ColumnValue booleanValue(Boolean value) {
+  private static TColumnValue booleanValue(Boolean value) {
     TBoolValue tBoolValue = new TBoolValue();
     if (value != null) {
       tBoolValue.setValue(value);
     }
-    return new ColumnValue(TColumnValue.boolVal(tBoolValue));
+    return TColumnValue.boolVal(tBoolValue);
   }
 
-  public static ColumnValue byteValue(Byte value) {
+  private static TColumnValue byteValue(Byte value) {
     TByteValue tByteValue = new TByteValue();
     if (value != null) {
       tByteValue.setValue(value);
     }
-    return new ColumnValue(TColumnValue.byteVal(tByteValue));
+    return TColumnValue.byteVal(tByteValue);
   }
 
-  public static ColumnValue shortValue(Short value) {
+  private static TColumnValue shortValue(Short value) {
     TI16Value tI16Value = new TI16Value();
     if (value != null) {
       tI16Value.setValue(value);
     }
-    return new ColumnValue(TColumnValue.i16Val(tI16Value));
+    return TColumnValue.i16Val(tI16Value);
   }
 
-  public static ColumnValue intValue(Integer value) {
+  private static TColumnValue intValue(Integer value) {
     TI32Value tI32Value = new TI32Value();
     if (value != null) {
       tI32Value.setValue(value);
     }
-    return new ColumnValue(TColumnValue.i32Val(tI32Value));
+    return TColumnValue.i32Val(tI32Value);
   }
 
-  public static ColumnValue longValue(Long value) {
+  private static TColumnValue longValue(Long value) {
     TI64Value tI64Value = new TI64Value();
     if (value != null) {
       tI64Value.setValue(value);
     }
-    return new ColumnValue(TColumnValue.i64Val(tI64Value));
+    return TColumnValue.i64Val(tI64Value);
   }
 
-  public static ColumnValue floatValue(Float value) {
+  private static TColumnValue floatValue(Float value) {
     TDoubleValue tDoubleValue = new TDoubleValue();
     if (value != null) {
       tDoubleValue.setValue(value);
     }
-    return new ColumnValue(TColumnValue.doubleVal(tDoubleValue));
+    return TColumnValue.doubleVal(tDoubleValue);
   }
 
-  public static ColumnValue doubleValue(Double value) {
+  private static TColumnValue doubleValue(Double value) {
     TDoubleValue tDoubleValue = new TDoubleValue();
     if (value != null) {
       tDoubleValue.setValue(value);
     }
-    return new ColumnValue(TColumnValue.doubleVal(tDoubleValue));
+    return TColumnValue.doubleVal(tDoubleValue);
   }
 
-  public static ColumnValue stringValue(String value) {
+  private static TColumnValue stringValue(String value) {
     TStringValue tStringValue = new TStringValue();
     if (value != null) {
       tStringValue.setValue(value);
     }
-    return new ColumnValue(TColumnValue.stringVal(tStringValue));
+    return TColumnValue.stringVal(tStringValue);
   }
 
-  public static ColumnValue stringValue(HiveChar value) {
+  private static TColumnValue stringValue(HiveChar value) {
     TStringValue tStringValue = new TStringValue();
     if (value != null) {
       tStringValue.setValue(value.toString());
     }
-    return new ColumnValue(TColumnValue.stringVal(tStringValue));
+    return TColumnValue.stringVal(tStringValue);
   }
 
-  public static ColumnValue stringValue(HiveVarchar value) {
+  private static TColumnValue stringValue(HiveVarchar value) {
     TStringValue tStringValue = new TStringValue();
     if (value != null) {
       tStringValue.setValue(value.toString());
     }
-    return new ColumnValue(TColumnValue.stringVal(tStringValue));
+    return TColumnValue.stringVal(tStringValue);
   }
 
-  public static ColumnValue dateValue(Date value) {
+  private static TColumnValue dateValue(Date value) {
     TStringValue tStringValue = new TStringValue();
     if (value != null) {
       tStringValue.setValue(value.toString());
     }
-    return new ColumnValue(TColumnValue.stringVal(tStringValue));
+    return new TColumnValue(TColumnValue.stringVal(tStringValue));
   }
 
-  public static ColumnValue timestampValue(Timestamp value) {
+  private static TColumnValue timestampValue(Timestamp value) {
     TStringValue tStringValue = new TStringValue();
     if (value != null) {
       tStringValue.setValue(value.toString());
     }
-    return new ColumnValue(TColumnValue.stringVal(tStringValue));
+    return TColumnValue.stringVal(tStringValue);
   }
 
-  public static ColumnValue stringValue(HiveDecimal value) {
+  private static TColumnValue stringValue(HiveDecimal value) {
     TStringValue tStrValue = new TStringValue();
     if (value != null) {
       tStrValue.setValue(value.toString());
     }
-    return new ColumnValue(TColumnValue.stringVal(tStrValue));
+    return TColumnValue.stringVal(tStrValue);
   }
 
-  public static ColumnValue newColumnValue(Type type, Object value) {
+  public static TColumnValue toTColumnValue(Type type, Object value) {
     switch (type) {
     case BOOLEAN_TYPE:
       return booleanValue((Boolean)value);
@@ -189,6 +173,7 @@ public class ColumnValue {
     case DECIMAL_TYPE:
       return stringValue(((HiveDecimal)value));
     case BINARY_TYPE:
+      return stringValue((String)value);
     case ARRAY_TYPE:
     case MAP_TYPE:
     case STRUCT_TYPE:
@@ -200,8 +185,101 @@ public class ColumnValue {
     }
   }
 
-  public TColumnValue toTColumnValue() {
-    return new TColumnValue(tColumnValue);
+  private static Boolean getBooleanValue(TBoolValue tBoolValue) {
+    if (tBoolValue.isSetValue()) {
+      return tBoolValue.isValue();
+    }
+    return null;
+  }
+
+  private static Byte getByteValue(TByteValue tByteValue) {
+    if (tByteValue.isSetValue()) {
+      return tByteValue.getValue();
+    }
+    return null;
+  }
+
+  private static Short getShortValue(TI16Value tI16Value) {
+    if (tI16Value.isSetValue()) {
+      return tI16Value.getValue();
+    }
+    return null;
+  }
+
+  private static Integer getIntegerValue(TI32Value tI32Value) {
+    if (tI32Value.isSetValue()) {
+      return tI32Value.getValue();
+    }
+    return null;
+  }
+
+  private static Long getLongValue(TI64Value tI64Value) {
+    if (tI64Value.isSetValue()) {
+      return tI64Value.getValue();
+    }
+    return null;
+  }
+
+  private static Double getDoubleValue(TDoubleValue tDoubleValue) {
+    if (tDoubleValue.isSetValue()) {
+      return tDoubleValue.getValue();
+    }
+    return null;
   }
 
+  private static String getStringValue(TStringValue tStringValue) {
+    if (tStringValue.isSetValue()) {
+      return tStringValue.getValue();
+    }
+    return null;
+  }
+
+  private static Date getDateValue(TStringValue tStringValue) {
+    if (tStringValue.isSetValue()) {
+      return Date.valueOf(tStringValue.getValue());
+    }
+    return null;
+  }
+
+  private static Timestamp getTimestampValue(TStringValue tStringValue) {
+    if (tStringValue.isSetValue()) {
+      return Timestamp.valueOf(tStringValue.getValue());
+    }
+    return null;
+  }
+
+  private static byte[] getBinaryValue(TStringValue tString) {
+    if (tString.isSetValue()) {
+      return tString.getValue().getBytes();
+    }
+    return null;
+  }
+
+  private static BigDecimal getBigDecimalValue(TStringValue tStringValue) {
+    if (tStringValue.isSetValue()) {
+      return new BigDecimal(tStringValue.getValue());
+    }
+    return null;
+  }
+
+  public static Object toColumnValue(TColumnValue value) {
+    TColumnValue._Fields field = value.getSetField();
+    switch (field) {
+      case BOOL_VAL:
+        return getBooleanValue(value.getBoolVal());
+      case BYTE_VAL:
+        return getByteValue(value.getByteVal());
+      case I16_VAL:
+        return getShortValue(value.getI16Val());
+      case I32_VAL:
+        return getIntegerValue(value.getI32Val());
+      case I64_VAL:
+        return getLongValue(value.getI64Val());
+      case DOUBLE_VAL:
+        return getDoubleValue(value.getDoubleVal());
+      case STRING_VAL:
+        return getStringValue(value.getStringVal());
+    }
+    throw new IllegalArgumentException("never");
+  }
 }

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/OperationHandle.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/OperationHandle.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/OperationHandle.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/OperationHandle.java Fri Jan  3 01:34:08 2014
@@ -18,27 +18,30 @@
 package org.apache.hive.service.cli;
 
 import org.apache.hive.service.cli.thrift.TOperationHandle;
-
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
 
 public class OperationHandle extends Handle {
 
-  private OperationType opType = OperationType.EXECUTE_STATEMENT;
+  private final OperationType opType;
+  private final TProtocolVersion protocol;
   private boolean hasResultSet = false;
 
-  public OperationHandle() {
-    // TODO: make this type abstract
-    super();
-  }
-
-  public OperationHandle(OperationType opType) {
+  public OperationHandle(OperationType opType, TProtocolVersion protocol) {
     super();
     this.opType = opType;
+    this.protocol = protocol;
   }
 
+  // dummy handle for ThriftCLIService
   public OperationHandle(TOperationHandle tOperationHandle) {
+    this(tOperationHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1);
+  }
+
+  public OperationHandle(TOperationHandle tOperationHandle, TProtocolVersion protocol) {
     super(tOperationHandle.getOperationId());
     this.opType = OperationType.getOperationType(tOperationHandle.getOperationType());
     this.hasResultSet = tOperationHandle.isHasResultSet();
+    this.protocol = protocol;
   }
 
   public OperationType getOperationType() {
@@ -61,6 +64,10 @@ public class OperationHandle extends Han
     return tOperationHandle;
   }
 
+  public TProtocolVersion getProtocolVersion() {
+    return protocol;
+  }
+
   @Override
   public int hashCode() {
     final int prime = 31;

Added: hive/trunk/service/src/java/org/apache/hive/service/cli/RowBasedSet.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/RowBasedSet.java?rev=1554989&view=auto
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/RowBasedSet.java (added)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/RowBasedSet.java Fri Jan  3 01:34:08 2014
@@ -0,0 +1,140 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hive.service.cli;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.hive.service.cli.thrift.TColumnValue;
+import org.apache.hive.service.cli.thrift.TRow;
+import org.apache.hive.service.cli.thrift.TRowSet;
+
+/**
+ * RowBasedSet
+ */
+public class RowBasedSet implements RowSet {
+
+  private long startOffset;
+
+  private final Type[] types; // non-null only for writing (server-side)
+  private final RemovableList<TRow> rows;
+
+  public RowBasedSet(TableSchema schema) {
+    types = schema.toTypes();
+    rows = new RemovableList<TRow>();
+  }
+
+  public RowBasedSet(TRowSet tRowSet) {
+    types = null;
+    rows = new RemovableList<TRow>(tRowSet.getRows());
+    startOffset = tRowSet.getStartRowOffset();
+  }
+
+  private RowBasedSet(Type[] types, List<TRow> rows, long startOffset) {
+    this.types = types;
+    this.rows = new RemovableList<TRow>(rows);
+    this.startOffset = startOffset;
+  }
+
+  @Override
+  public RowBasedSet addRow(Object[] fields) {
+    TRow tRow = new TRow();
+    for (int i = 0; i < fields.length; i++) {
+      tRow.addToColVals(ColumnValue.toTColumnValue(types[i], fields[i]));
+    }
+    rows.add(tRow);
+    return this;
+  }
+
+  @Override
+  public int numColumns() {
+    return rows.isEmpty() ? 0 : rows.get(0).getColVals().size();
+  }
+
+  @Override
+  public int numRows() {
+    return rows.size();
+  }
+
+  public RowBasedSet extractSubset(int maxRows) {
+    int numRows = Math.min(numRows(), maxRows);
+    RowBasedSet result = new RowBasedSet(types, rows.subList(0, numRows), startOffset);
+    rows.removeRange(0, numRows);
+    startOffset += numRows;
+    return result;
+  }
+
+  public long getStartOffset() {
+    return startOffset;
+  }
+
+  public void setStartOffset(long startOffset) {
+    this.startOffset = startOffset;
+  }
+
+  public int getSize() {
+    return rows.size();
+  }
+
+  public TRowSet toTRowSet() {
+    TRowSet tRowSet = new TRowSet();
+    tRowSet.setStartRowOffset(startOffset);
+    tRowSet.setRows(new ArrayList<TRow>(rows));
+    return tRowSet;
+  }
+
+  @Override
+  public Iterator<Object[]> iterator() {
+    return new Iterator<Object[]>() {
+
+      final Iterator<TRow> iterator = rows.iterator();
+      final Object[] convey = new Object[numColumns()];
+
+      @Override
+      public boolean hasNext() {
+        return iterator.hasNext();
+      }
+
+      @Override
+      public Object[] next() {
+        TRow row = iterator.next();
+        List<TColumnValue> values = row.getColVals();
+        for (int i = 0; i < values.size(); i++) {
+          convey[i] = ColumnValue.toColumnValue(values.get(i));
+        }
+        return convey;
+      }
+
+      @Override
+      public void remove() {
+        throw new UnsupportedOperationException("remove");
+      }
+    };
+  }
+
+  private static class RemovableList<E> extends ArrayList<E> {
+    public RemovableList() { super(); }
+    public RemovableList(List<E> rows) { super(rows); }
+    @Override
+    public void removeRange(int fromIndex, int toIndex) {
+      super.removeRange(fromIndex, toIndex);
+    }
+  }
+}

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/RowSet.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/RowSet.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/RowSet.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/RowSet.java Fri Jan  3 01:34:08 2014
@@ -18,107 +18,21 @@
 
 package org.apache.hive.service.cli;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.hive.service.cli.thrift.TRow;
 import org.apache.hive.service.cli.thrift.TRowSet;
 
-/**
- * RowSet.
- *
- */
-public class RowSet {
-
-  private long startOffset = 0;
-  private boolean hasMoreResults = false;
-  private List<Row> rows;
-
-  public RowSet() {
-    rows = new ArrayList<Row>();
-  }
-
-  public RowSet(TRowSet tRowSet) {
-    this();
-    startOffset = tRowSet.getStartRowOffset();
-    for (TRow tRow : tRowSet.getRows()) {
-      rows.add(new Row(tRow));
-    }
-  }
-
-  public RowSet(List<Row> rows, long startOffset) {
-    this();
-    this.rows.addAll(rows);
-    this.startOffset = startOffset;
-  }
-
-  public RowSet addRow(Row row) {
-    rows.add(row);
-    return this;
-  }
-
-  public RowSet addRow(TableSchema schema, Object[] fields) {
-    return addRow(new Row(schema, fields));
-  }
-
-  public RowSet extractSubset(int maxRows) {
-    int numRows = rows.size();
-    maxRows = (maxRows <= numRows) ? maxRows : numRows;
-    RowSet result = new RowSet(rows.subList(0, maxRows), startOffset);
-    rows = new ArrayList<Row>(rows.subList(maxRows, numRows));
-    startOffset += result.getSize();
-    return result;
-  }
-
-  public long getStartOffset() {
-    return startOffset;
-  }
-
-  public RowSet setStartOffset(long startOffset) {
-    this.startOffset = startOffset;
-    return this;
-  }
-
-  public boolean getHasMoreResults() {
-    return hasMoreResults;
-  }
-
-  public RowSet setHasMoreResults(boolean hasMoreResults) {
-    this.hasMoreResults = hasMoreResults;
-    return this;
-  }
-
-  public int getSize() {
-    return rows.size();
-  }
-
-  public TRowSet toTRowSet() {
-    TRowSet tRowSet = new TRowSet();
-    tRowSet.setStartRowOffset(startOffset);
-    List<TRow> tRows = new ArrayList<TRow>();
-    for (Row row : rows) {
-      tRows.add(row.toTRow());
-    }
-    tRowSet.setRows(tRows);
-
-    /*
-    //List<Boolean> booleanColumn = new ArrayList<Boolean>();
-    //List<Byte> byteColumn = new ArrayList<Byte>();
-    //List<Short> shortColumn = new ArrayList<Short>();
-    List<Integer> integerColumn = new ArrayList<Integer>();
-
-    integerColumn.add(1);
-    //integerColumn.add(null);
-    integerColumn.add(3);
-    //integerColumn.add(null);
-
-
-    TColumnUnion column = TColumnUnion.i32Column(integerColumn);
-    List<TColumnUnion> columns = new ArrayList<TColumnUnion>();
-    columns.add(column);
-    tRowSet.setColumns(columns);
-    */
+public interface RowSet extends Iterable<Object[]> {
+
+  RowSet addRow(Object[] fields);
+
+  RowSet extractSubset(int maxRows);
+
+  int numColumns();
+
+  int numRows();
+
+  long getStartOffset();
+
+  void setStartOffset(long startOffset);
 
-    return tRowSet;
-  }
+  TRowSet toTRowSet();
 }

Added: hive/trunk/service/src/java/org/apache/hive/service/cli/RowSetFactory.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/RowSetFactory.java?rev=1554989&view=auto
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/RowSetFactory.java (added)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/RowSetFactory.java Fri Jan  3 01:34:08 2014
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hive.service.cli;
+
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
+import org.apache.hive.service.cli.thrift.TRowSet;
+
+import static org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V6;
+
+public class RowSetFactory {
+
+  public static RowSet create(TableSchema schema, TProtocolVersion version) {
+    if (version.getValue() >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue()) {
+      return new ColumnBasedSet(schema);
+    }
+    return new RowBasedSet(schema);
+  }
+
+  public static RowSet create(TRowSet results, TProtocolVersion version) {
+    if (version.getValue() >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue()) {
+      return new ColumnBasedSet(results);
+    }
+    return new RowBasedSet(results);
+  }
+}

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/SessionHandle.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/SessionHandle.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/SessionHandle.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/SessionHandle.java Fri Jan  3 01:34:08 2014
@@ -20,6 +20,7 @@ package org.apache.hive.service.cli;
 
 import java.util.UUID;
 
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
 import org.apache.hive.service.cli.thrift.TSessionHandle;
 
 
@@ -29,16 +30,20 @@ import org.apache.hive.service.cli.thrif
  */
 public class SessionHandle extends Handle {
 
-  public SessionHandle() {
-    super();
-  }
+  private final TProtocolVersion protocol;
 
-  public SessionHandle(HandleIdentifier handleId) {
-    super(handleId);
+  public SessionHandle(TProtocolVersion protocol) {
+    this.protocol = protocol;
   }
 
+  // dummy handle for ThriftCLIService
   public SessionHandle(TSessionHandle tSessionHandle) {
+    this(tSessionHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1);
+  }
+
+  public SessionHandle(TSessionHandle tSessionHandle, TProtocolVersion protocol) {
     super(tSessionHandle.getSessionId());
+    this.protocol = protocol;
   }
 
   public UUID getSessionId() {
@@ -51,6 +56,10 @@ public class SessionHandle extends Handl
     return tSessionHandle;
   }
 
+  public TProtocolVersion getProtocolVersion() {
+    return protocol;
+  }
+
   @Override
   public String toString() {
     return "SessionHandle [" + getHandleIdentifier() + "]";

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/TableSchema.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/TableSchema.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/TableSchema.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/TableSchema.java Fri Jan  3 01:34:08 2014
@@ -82,6 +82,14 @@ public class TableSchema {
     return tTableSchema;
   }
 
+  public Type[] toTypes() {
+    Type[] types = new Type[columns.size()];
+    for (int i = 0; i < types.length; i++) {
+      types[i] = columns.get(i).getType();
+    }
+    return types;
+  }
+
   public TableSchema addPrimitiveColumn(String columnName, Type columnType, String columnComment) {
     columns.add(ColumnDescriptor.newPrimitiveColumnDescriptor(columnName, columnComment, columnType, columns.size() + 1));
     return this;

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java Fri Jan  3 01:34:08 2014
@@ -18,13 +18,12 @@
 
 package org.apache.hive.service.cli.operation;
 
-import java.util.EnumSet;
-
 import org.apache.hive.service.cli.FetchOrientation;
 import org.apache.hive.service.cli.HiveSQLException;
 import org.apache.hive.service.cli.OperationState;
 import org.apache.hive.service.cli.OperationType;
 import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.session.HiveSession;
 
@@ -36,10 +35,11 @@ public class GetCatalogsOperation extend
   private static final TableSchema RESULT_SET_SCHEMA = new TableSchema()
   .addStringColumn("TABLE_CAT", "Catalog name. NULL if not applicable.");
 
-  private final RowSet rowSet = new RowSet();
+  private final RowSet rowSet;
 
   protected GetCatalogsOperation(HiveSession parentSession) {
     super(parentSession, OperationType.GET_CATALOGS);
+    rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
   }
 
   /* (non-Javadoc)

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java Fri Jan  3 01:34:08 2014
@@ -20,7 +20,6 @@ package org.apache.hive.service.cli.oper
 
 import java.sql.DatabaseMetaData;
 import java.util.Collections;
-import java.util.EnumSet;
 import java.util.List;
 import java.util.regex.Pattern;
 
@@ -32,6 +31,7 @@ import org.apache.hive.service.cli.HiveS
 import org.apache.hive.service.cli.OperationState;
 import org.apache.hive.service.cli.OperationType;
 import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.Type;
 import org.apache.hive.service.cli.session.HiveSession;
@@ -102,7 +102,7 @@ public class GetColumnsOperation extends
   private final String tableName;
   private final String columnName;
 
-  private final RowSet rowSet = new RowSet();
+  private final RowSet rowSet;
 
   protected GetColumnsOperation(HiveSession parentSession, String catalogName, String schemaName,
       String tableName, String columnName) {
@@ -111,6 +111,7 @@ public class GetColumnsOperation extends
     this.schemaName = schemaName;
     this.tableName = tableName;
     this.columnName = columnName;
+    this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
   }
 
   /* (non-Javadoc)
@@ -165,7 +166,7 @@ public class GetColumnsOperation extends
                 null, // SOURCE_DATA_TYPE
                 "NO", // IS_AUTO_INCREMENT
             };
-            rowSet.addRow(RESULT_SET_SCHEMA, rowData);
+            rowSet.addRow(rowData);
           }
         }
       }

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java Fri Jan  3 01:34:08 2014
@@ -19,7 +19,6 @@
 package org.apache.hive.service.cli.operation;
 
 import java.sql.DatabaseMetaData;
-import java.util.EnumSet;
 import java.util.Set;
 
 import org.apache.hadoop.hive.ql.exec.FunctionInfo;
@@ -30,6 +29,7 @@ import org.apache.hive.service.cli.HiveS
 import org.apache.hive.service.cli.OperationState;
 import org.apache.hive.service.cli.OperationType;
 import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.Type;
 import org.apache.hive.service.cli.session.HiveSession;
@@ -57,7 +57,7 @@ public class GetFunctionsOperation exten
   private final String schemaName;
   private final String functionName;
 
-  private final RowSet rowSet = new RowSet();
+  private final RowSet rowSet;
 
   public GetFunctionsOperation(HiveSession parentSession,
       String catalogName, String schemaName, String functionName) {
@@ -65,6 +65,7 @@ public class GetFunctionsOperation exten
     this.catalogName = catalogName;
     this.schemaName = schemaName;
     this.functionName = functionName;
+    this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
   }
 
   /* (non-Javadoc)
@@ -90,7 +91,7 @@ public class GetFunctionsOperation exten
                   : DatabaseMetaData.functionNoTable), // FUNCTION_TYPE
              functionInfo.getClass().getCanonicalName()
           };
-          rowSet.addRow(RESULT_SET_SCHEMA, rowData);
+          rowSet.addRow(rowData);
         }
       }
       setState(OperationState.FINISHED);

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java Fri Jan  3 01:34:08 2014
@@ -18,14 +18,13 @@
 
 package org.apache.hive.service.cli.operation;
 
-import java.util.EnumSet;
-
 import org.apache.hadoop.hive.metastore.IMetaStoreClient;
 import org.apache.hive.service.cli.FetchOrientation;
 import org.apache.hive.service.cli.HiveSQLException;
 import org.apache.hive.service.cli.OperationState;
 import org.apache.hive.service.cli.OperationType;
 import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.session.HiveSession;
 
@@ -48,6 +47,7 @@ public class GetSchemasOperation extends
     super(parentSession, OperationType.GET_SCHEMAS);
     this.catalogName = catalogName;
     this.schemaName = schemaName;
+    this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
   }
 
   /* (non-Javadoc)
@@ -56,12 +56,11 @@ public class GetSchemasOperation extends
   @Override
   public void run() throws HiveSQLException {
     setState(OperationState.RUNNING);
-    rowSet = new RowSet();
     try {
       IMetaStoreClient metastoreClient = getParentSession().getMetaStoreClient();
       String schemaPattern = convertSchemaPattern(schemaName);
       for (String dbName : metastoreClient.getDatabases(schemaPattern)) {
-        rowSet.addRow(RESULT_SET_SCHEMA, new Object[] {dbName, DEFAULT_HIVE_CATALOG});
+        rowSet.addRow(new Object[] {dbName, DEFAULT_HIVE_CATALOG});
       }
       setState(OperationState.FINISHED);
     } catch (Exception e) {

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java Fri Jan  3 01:34:08 2014
@@ -18,7 +18,6 @@
 
 package org.apache.hive.service.cli.operation;
 
-import java.util.EnumSet;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.metastore.TableType;
 import org.apache.hive.service.cli.FetchOrientation;
@@ -26,6 +25,7 @@ import org.apache.hive.service.cli.HiveS
 import org.apache.hive.service.cli.OperationState;
 import org.apache.hive.service.cli.OperationType;
 import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.session.HiveSession;
 
@@ -38,7 +38,7 @@ public class GetTableTypesOperation exte
   protected static TableSchema RESULT_SET_SCHEMA = new TableSchema()
   .addStringColumn("TABLE_TYPE", "Table type name.");
 
-  private RowSet rowSet;
+  private final RowSet rowSet;
   private final TableTypeMapping tableTypeMapping;
 
   protected GetTableTypesOperation(HiveSession parentSession) {
@@ -47,6 +47,7 @@ public class GetTableTypesOperation exte
         getVar(HiveConf.ConfVars.HIVE_SERVER2_TABLE_TYPE_MAPPING);
     tableTypeMapping =
       TableTypeMappingFactory.getTableTypeMapping(tableMappingStr);
+    rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
   }
 
   /* (non-Javadoc)
@@ -56,10 +57,8 @@ public class GetTableTypesOperation exte
   public void run() throws HiveSQLException {
     setState(OperationState.RUNNING);
     try {
-      rowSet = new RowSet();
       for (TableType type : TableType.values()) {
-        rowSet.addRow(RESULT_SET_SCHEMA,
-            new String[] {tableTypeMapping.mapToClientType(type.toString())});
+        rowSet.addRow(new String[] {tableTypeMapping.mapToClientType(type.toString())});
       }
       setState(OperationState.FINISHED);
     } catch (Exception e) {

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTablesOperation.java Fri Jan  3 01:34:08 2014
@@ -19,7 +19,6 @@
 package org.apache.hive.service.cli.operation;
 
 import java.util.ArrayList;
-import java.util.EnumSet;
 import java.util.List;
 
 import org.apache.hadoop.hive.conf.HiveConf;
@@ -30,6 +29,7 @@ import org.apache.hive.service.cli.HiveS
 import org.apache.hive.service.cli.OperationState;
 import org.apache.hive.service.cli.OperationType;
 import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.session.HiveSession;
 
@@ -43,7 +43,7 @@ public class GetTablesOperation extends 
   private final String schemaName;
   private final String tableName;
   private final List<String> tableTypes = new ArrayList<String>();
-  private final RowSet rowSet = new RowSet();
+  private final RowSet rowSet;
   private final TableTypeMapping tableTypeMapping;
 
 
@@ -68,6 +68,7 @@ public class GetTablesOperation extends 
     if (tableTypes != null) {
       this.tableTypes.addAll(tableTypes);
     }
+    this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
   }
 
   /* (non-Javadoc)
@@ -92,7 +93,7 @@ public class GetTablesOperation extends 
               };
           if (tableTypes.isEmpty() || tableTypes.contains(
                 tableTypeMapping.mapToClientType(table.getTableType()))) {
-            rowSet.addRow(RESULT_SET_SCHEMA, rowData);
+            rowSet.addRow(rowData);
           }
         }
       }

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java Fri Jan  3 01:34:08 2014
@@ -18,13 +18,12 @@
 
 package org.apache.hive.service.cli.operation;
 
-import java.util.EnumSet;
-
 import org.apache.hive.service.cli.FetchOrientation;
 import org.apache.hive.service.cli.HiveSQLException;
 import org.apache.hive.service.cli.OperationState;
 import org.apache.hive.service.cli.OperationType;
 import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.Type;
 import org.apache.hive.service.cli.session.HiveSession;
@@ -73,10 +72,11 @@ public class GetTypeInfoOperation extend
   .addPrimitiveColumn("NUM_PREC_RADIX", Type.INT_TYPE,
       "Usually 2 or 10");
 
-  private final RowSet rowSet = new RowSet();
+  private final RowSet rowSet;
 
   protected GetTypeInfoOperation(HiveSession parentSession) {
     super(parentSession, OperationType.GET_TYPE_INFO);
+    rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion());
   }
 
   /* (non-Javadoc)
@@ -107,7 +107,7 @@ public class GetTypeInfoOperation extend
             null, // SQL_DATETIME_SUB, unused
             type.getNumPrecRadix() //NUM_PREC_RADIX
         };
-        rowSet.addRow(RESULT_SET_SCHEMA, rowData);
+        rowSet.addRow(rowData);
       }
       setState(OperationState.FINISHED);
     } catch (Exception e) {

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java Fri Jan  3 01:34:08 2014
@@ -27,7 +27,6 @@ import java.io.IOException;
 import java.io.PrintStream;
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
-import java.util.EnumSet;
 import java.util.List;
 import java.util.Map;
 
@@ -40,6 +39,7 @@ import org.apache.hive.service.cli.Fetch
 import org.apache.hive.service.cli.HiveSQLException;
 import org.apache.hive.service.cli.OperationState;
 import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.session.HiveSession;
 
@@ -158,10 +158,10 @@ public class HiveCommandOperation extend
       resetResultReader();
     }
     List<String> rows = readResults((int) maxRows);
-    RowSet rowSet = new RowSet();
+    RowSet rowSet = RowSetFactory.create(resultSchema, getProtocolVersion());
 
     for (String row : rows) {
-      rowSet.addRow(resultSchema, new String[] {row});
+      rowSet.addRow(new String[] {row});
     }
     return rowSet;
   }

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/operation/Operation.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/operation/Operation.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/operation/Operation.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/operation/Operation.java Fri Jan  3 01:34:08 2014
@@ -31,7 +31,7 @@ import org.apache.hive.service.cli.Opera
 import org.apache.hive.service.cli.RowSet;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.session.HiveSession;
-
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
 
 
 public abstract class Operation {
@@ -50,7 +50,7 @@ public abstract class Operation {
   protected Operation(HiveSession parentSession, OperationType opType) {
     super();
     this.parentSession = parentSession;
-    opHandle = new OperationHandle(opType);
+    this.opHandle = new OperationHandle(opType, parentSession.getProtocolVersion());
   }
 
   public void setConfiguration(HiveConf configuration) {
@@ -69,6 +69,10 @@ public abstract class Operation {
     return opHandle;
   }
 
+  public TProtocolVersion getProtocolVersion() {
+    return opHandle.getProtocolVersion();
+  }
+
   public OperationType getType() {
     return opHandle.getOperationType();
   }

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java Fri Jan  3 01:34:08 2014
@@ -50,8 +50,8 @@ import org.apache.hadoop.io.BytesWritabl
 import org.apache.hive.service.cli.FetchOrientation;
 import org.apache.hive.service.cli.HiveSQLException;
 import org.apache.hive.service.cli.OperationState;
-import org.apache.hive.service.cli.OperationStatus;
 import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.session.HiveSession;
 
@@ -231,6 +231,8 @@ public class SQLOperation extends Execut
     validateDefaultFetchOrientation(orientation);
     assertState(OperationState.FINISHED);
 
+    RowSet rowSet = RowSetFactory.create(resultSchema, getProtocolVersion());
+
     try {
       /* if client is requesting fetch-from-start and its not the first time reading from this operation
        * then reset the fetch position to beginning
@@ -241,9 +243,9 @@ public class SQLOperation extends Execut
       fetchStarted = true;
       driver.setMaxRows((int) maxRows);
       if (driver.getResults(convey)) {
-        return decode(convey);
+        return decode(convey, rowSet);
       }
-      return new RowSet();
+      return rowSet;
     } catch (IOException e) {
       throw new HiveSQLException(e);
     } catch (CommandNeedRetryException e) {
@@ -255,41 +257,41 @@ public class SQLOperation extends Execut
     }
   }
 
-  private RowSet decode(List<Object> rows) throws Exception {
+  private RowSet decode(List<Object> rows, RowSet rowSet) throws Exception {
     if (driver.isFetchingTable()) {
-      return prepareFromRow(rows);
+      return prepareFromRow(rows, rowSet);
     }
-    return decodeFromString(rows);
+    return decodeFromString(rows, rowSet);
   }
 
   // already encoded to thrift-able object in ThriftFormatter
-  private RowSet prepareFromRow(List<Object> rows) throws Exception {
-    RowSet rowSet = new RowSet();
+  private RowSet prepareFromRow(List<Object> rows, RowSet rowSet) throws Exception {
     for (Object row : rows) {
-      rowSet.addRow(resultSchema, (Object[]) row);
+      rowSet.addRow((Object[]) row);
     }
     return rowSet;
   }
 
-  private RowSet decodeFromString(List<Object> rows) throws SQLException, SerDeException {
+  private RowSet decodeFromString(List<Object> rows, RowSet rowSet)
+      throws SQLException, SerDeException {
     getSerDe();
     StructObjectInspector soi = (StructObjectInspector) serde.getObjectInspector();
     List<? extends StructField> fieldRefs = soi.getAllStructFieldRefs();
-    RowSet rowSet = new RowSet();
 
     Object[] deserializedFields = new Object[fieldRefs.size()];
     Object rowObj;
     ObjectInspector fieldOI;
 
+    int protocol = getProtocolVersion().getValue();
     for (Object rowString : rows) {
       rowObj = serde.deserialize(new BytesWritable(((String)rowString).getBytes()));
       for (int i = 0; i < fieldRefs.size(); i++) {
         StructField fieldRef = fieldRefs.get(i);
         fieldOI = fieldRef.getFieldObjectInspector();
         Object fieldData = soi.getStructFieldData(rowObj, fieldRef);
-        deserializedFields[i] = SerDeUtils.toThriftPayload(fieldData, fieldOI);
+        deserializedFields[i] = SerDeUtils.toThriftPayload(fieldData, fieldOI, protocol);
       }
-      rowSet.addRow(resultSchema, deserializedFields);
+      rowSet.addRow(deserializedFields);
     }
     return rowSet;
   }

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSession.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSession.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSession.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSession.java Fri Jan  3 01:34:08 2014
@@ -33,8 +33,12 @@ import org.apache.hive.service.cli.RowSe
 import org.apache.hive.service.cli.SessionHandle;
 import org.apache.hive.service.cli.TableSchema;
 import org.apache.hive.service.cli.operation.OperationManager;
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
 
 public interface HiveSession {
+
+  TProtocolVersion getProtocolVersion();
+
   /**
    * Set the session manager for the session
    * @param sessionManager

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java Fri Jan  3 01:34:08 2014
@@ -54,6 +54,7 @@ import org.apache.hive.service.cli.opera
 import org.apache.hive.service.cli.operation.GetTypeInfoOperation;
 import org.apache.hive.service.cli.operation.MetadataOperation;
 import org.apache.hive.service.cli.operation.OperationManager;
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
 
 /**
  * HiveSession
@@ -61,7 +62,8 @@ import org.apache.hive.service.cli.opera
  */
 public class HiveSessionImpl implements HiveSession {
 
-  private final SessionHandle sessionHandle = new SessionHandle();
+  private final SessionHandle sessionHandle;
+
   private String username;
   private final String password;
   private final Map<String, String> sessionConf = new HashMap<String, String>();
@@ -78,9 +80,11 @@ public class HiveSessionImpl implements 
   private IMetaStoreClient metastoreClient = null;
   private final Set<OperationHandle> opHandleSet = new HashSet<OperationHandle>();
 
-  public HiveSessionImpl(String username, String password, Map<String, String> sessionConf) {
+  public HiveSessionImpl(TProtocolVersion protocol, String username, String password,
+      Map<String, String> sessionConf) {
     this.username = username;
     this.password = password;
+    this.sessionHandle = new SessionHandle(protocol);
 
     if (sessionConf != null) {
       for (Map.Entry<String, String> entry : sessionConf.entrySet()) {
@@ -93,10 +97,15 @@ public class HiveSessionImpl implements 
     // use thrift transportable formatter
     hiveConf.set(ListSinkOperator.OUTPUT_FORMATTER,
         FetchFormatter.ThriftFormatter.class.getName());
+    hiveConf.setInt(ListSinkOperator.OUTPUT_PROTOCOL, protocol.getValue());
     sessionState = new SessionState(hiveConf);
     SessionState.start(sessionState);
   }
 
+  public TProtocolVersion getProtocolVersion() {
+    return sessionHandle.getProtocolVersion();
+  }
+
   public SessionManager getSessionManager() {
     return sessionManager;
   }

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java Fri Jan  3 01:34:08 2014
@@ -26,6 +26,7 @@ import org.apache.hadoop.hive.ql.metadat
 import org.apache.hadoop.hive.shims.ShimLoader;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hive.service.cli.HiveSQLException;
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
 
 /**
  *
@@ -40,9 +41,9 @@ public class HiveSessionImplwithUGI exte
   private Hive sessionHive = null;
   private HiveSession proxySession = null;
 
-  public HiveSessionImplwithUGI(String username, String password, Map<String, String> sessionConf,
-      String delegationToken) throws HiveSQLException {
-    super(username, password, sessionConf);
+  public HiveSessionImplwithUGI(TProtocolVersion protocol, String username, String password,
+      Map<String, String> sessionConf, String delegationToken) throws HiveSQLException {
+    super(protocol, username, password, sessionConf);
     setSessionUGI(username);
     setDelegationToken(delegationToken);
   }

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/session/SessionManager.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/session/SessionManager.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/session/SessionManager.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/session/SessionManager.java Fri Jan  3 01:34:08 2014
@@ -35,6 +35,7 @@ import org.apache.hive.service.Composite
 import org.apache.hive.service.cli.HiveSQLException;
 import org.apache.hive.service.cli.SessionHandle;
 import org.apache.hive.service.cli.operation.OperationManager;
+import org.apache.hive.service.cli.thrift.TProtocolVersion;
 
 /**
  * SessionManager.
@@ -92,24 +93,25 @@ public class SessionManager extends Comp
     }
   }
 
-  public SessionHandle openSession(String username, String password, Map<String, String> sessionConf)
-      throws HiveSQLException {
-    return openSession(username, password, sessionConf, false, null);
+  public SessionHandle openSession(TProtocolVersion protocol, String username, String password,
+      Map<String, String> sessionConf) throws HiveSQLException {
+    return openSession(protocol, username, password, sessionConf, false, null);
   }
 
-  public SessionHandle openSession(String username, String password, Map<String, String> sessionConf,
-      boolean withImpersonation, String delegationToken) throws HiveSQLException {
+  public SessionHandle openSession(TProtocolVersion protocol, String username, String password,
+      Map<String, String> sessionConf, boolean withImpersonation, String delegationToken)
+      throws HiveSQLException {
     if (username == null) {
       username = threadLocalUserName.get();
     }
     HiveSession session;
     if (withImpersonation) {
-      HiveSessionImplwithUGI hiveSessionUgi = new HiveSessionImplwithUGI(username, password,
-          sessionConf, delegationToken);
+      HiveSessionImplwithUGI hiveSessionUgi = new HiveSessionImplwithUGI(protocol, username, password,
+        sessionConf, delegationToken);
       session = HiveSessionProxy.getProxy(hiveSessionUgi, hiveSessionUgi.getSessionUgi());
       hiveSessionUgi.setProxySession(session);
     } else {
-      session = new HiveSessionImpl(username, password, sessionConf);
+      session = new HiveSessionImpl(protocol, username, password, sessionConf);
     }
     session.setSessionManager(this);
     session.setOperationManager(operationManager);

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/EmbeddedThriftBinaryCLIService.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/EmbeddedThriftBinaryCLIService.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/EmbeddedThriftBinaryCLIService.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/EmbeddedThriftBinaryCLIService.java Fri Jan  3 01:34:08 2014
@@ -20,6 +20,7 @@ package org.apache.hive.service.cli.thri
 
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hive.service.cli.CLIService;
+import org.apache.hive.service.cli.ICLIService;
 
 
 /**
@@ -34,4 +35,8 @@ public class EmbeddedThriftBinaryCLIServ
     cliService.init(new HiveConf());
     cliService.start();
   }
+
+  public ICLIService getService() {
+    return cliService;
+  }
 }

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java Fri Jan  3 01:34:08 2014
@@ -117,7 +117,7 @@ public abstract class ThriftCLIService e
     LOG.info("Client protocol version: " + req.getClient_protocol());
     TOpenSessionResp resp = new TOpenSessionResp();
     try {
-      SessionHandle sessionHandle = getSessionHandle(req);
+      SessionHandle sessionHandle = getSessionHandle(req, resp);
       resp.setSessionHandle(sessionHandle.toTSessionHandle());
       // TODO: set real configuration map
       resp.setConfiguration(new HashMap<String, String>());
@@ -138,35 +138,48 @@ public abstract class ThriftCLIService e
     }
   }
 
-  SessionHandle getSessionHandle(TOpenSessionReq req)
+  SessionHandle getSessionHandle(TOpenSessionReq req, TOpenSessionResp res)
       throws HiveSQLException, LoginException, IOException {
 
     String userName = getUserName(req);
+    TProtocolVersion protocol = getMinVersion(CLIService.SERVER_VERSION, req.getClient_protocol());
 
-    SessionHandle sessionHandle = null;
-    if (
-        cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION)
-        .equals(HiveAuthFactory.AuthTypes.KERBEROS.toString())
-        &&
-        cliService.getHiveConf().
-        getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS)
-        )
-    {
+    SessionHandle sessionHandle;
+    if (cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION)
+        .equals(HiveAuthFactory.AuthTypes.KERBEROS.toString()) &&
+        cliService.getHiveConf().getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS)) {
       String delegationTokenStr = null;
       try {
         delegationTokenStr = cliService.getDelegationTokenFromMetaStore(userName);
       } catch (UnsupportedOperationException e) {
         // The delegation token is not applicable in the given deployment mode
       }
-      sessionHandle = cliService.openSessionWithImpersonation(userName, req.getPassword(),
-          req.getConfiguration(), delegationTokenStr);
+      sessionHandle = cliService.openSessionWithImpersonation(protocol, userName,
+          req.getPassword(), req.getConfiguration(), delegationTokenStr);
     } else {
-      sessionHandle = cliService.openSession(userName, req.getPassword(),
+      sessionHandle = cliService.openSession(protocol, userName, req.getPassword(),
           req.getConfiguration());
     }
+    res.setServerProtocolVersion(protocol);
     return sessionHandle;
   }
 
+  private TProtocolVersion getMinVersion(TProtocolVersion... versions) {
+    TProtocolVersion[] values = TProtocolVersion.values();
+    int current = values[values.length - 1].getValue();
+    for (TProtocolVersion version : versions) {
+      if (current > version.getValue()) {
+        current = version.getValue();
+      }
+    }
+    for (TProtocolVersion version : values) {
+      if (version.getValue() == current) {
+        return version;
+      }
+    }
+    throw new IllegalArgumentException("never");
+  }
+
   @Override
   public TCloseSessionResp CloseSession(TCloseSessionReq req) throws TException {
     TCloseSessionResp resp = new TCloseSessionResp();

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java Fri Jan  3 01:34:08 2014
@@ -30,6 +30,7 @@ import org.apache.hive.service.cli.Opera
 import org.apache.hive.service.cli.OperationState;
 import org.apache.hive.service.cli.OperationStatus;
 import org.apache.hive.service.cli.RowSet;
+import org.apache.hive.service.cli.RowSetFactory;
 import org.apache.hive.service.cli.SessionHandle;
 import org.apache.hive.service.cli.TableSchema;
 
@@ -64,7 +65,7 @@ public class ThriftCLIServiceClient exte
       req.setConfiguration(configuration);
       TOpenSessionResp resp = cliService.OpenSession(req);
       checkStatus(resp.getStatus());
-      return new SessionHandle(resp.getSessionHandle());
+      return new SessionHandle(resp.getSessionHandle(), resp.getServerProtocolVersion());
     } catch (HiveSQLException e) {
       throw e;
     } catch (Exception e) {
@@ -146,7 +147,8 @@ public class ThriftCLIServiceClient exte
       req.setRunAsync(isAsync);
       TExecuteStatementResp resp = cliService.ExecuteStatement(req);
       checkStatus(resp.getStatus());
-      return new OperationHandle(resp.getOperationHandle());
+      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
+      return new OperationHandle(resp.getOperationHandle(), protocol);
     } catch (HiveSQLException e) {
       throw e;
     } catch (Exception e) {
@@ -163,7 +165,8 @@ public class ThriftCLIServiceClient exte
       TGetTypeInfoReq req = new TGetTypeInfoReq(sessionHandle.toTSessionHandle());
       TGetTypeInfoResp resp = cliService.GetTypeInfo(req);
       checkStatus(resp.getStatus());
-      return new OperationHandle(resp.getOperationHandle());
+      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
+      return new OperationHandle(resp.getOperationHandle(), protocol);
     } catch (HiveSQLException e) {
       throw e;
     } catch (Exception e) {
@@ -180,7 +183,8 @@ public class ThriftCLIServiceClient exte
       TGetCatalogsReq req = new TGetCatalogsReq(sessionHandle.toTSessionHandle());
       TGetCatalogsResp resp = cliService.GetCatalogs(req);
       checkStatus(resp.getStatus());
-      return new OperationHandle(resp.getOperationHandle());
+      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
+      return new OperationHandle(resp.getOperationHandle(), protocol);
     } catch (HiveSQLException e) {
       throw e;
     } catch (Exception e) {
@@ -201,7 +205,8 @@ public class ThriftCLIServiceClient exte
       req.setSchemaName(schemaName);
       TGetSchemasResp resp = cliService.GetSchemas(req);
       checkStatus(resp.getStatus());
-      return new OperationHandle(resp.getOperationHandle());
+      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
+      return new OperationHandle(resp.getOperationHandle(), protocol);
     } catch (HiveSQLException e) {
       throw e;
     } catch (Exception e) {
@@ -223,7 +228,8 @@ public class ThriftCLIServiceClient exte
       req.setSchemaName(schemaName);
       TGetTablesResp resp = cliService.GetTables(req);
       checkStatus(resp.getStatus());
-      return new OperationHandle(resp.getOperationHandle());
+      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
+      return new OperationHandle(resp.getOperationHandle(), protocol);
     } catch (HiveSQLException e) {
       throw e;
     } catch (Exception e) {
@@ -240,7 +246,8 @@ public class ThriftCLIServiceClient exte
       TGetTableTypesReq req = new TGetTableTypesReq(sessionHandle.toTSessionHandle());
       TGetTableTypesResp resp = cliService.GetTableTypes(req);
       checkStatus(resp.getStatus());
-      return new OperationHandle(resp.getOperationHandle());
+      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
+      return new OperationHandle(resp.getOperationHandle(), protocol);
     } catch (HiveSQLException e) {
       throw e;
     } catch (Exception e) {
@@ -264,7 +271,8 @@ public class ThriftCLIServiceClient exte
       req.setColumnName(columnName);
       TGetColumnsResp resp = cliService.GetColumns(req);
       checkStatus(resp.getStatus());
-      return new OperationHandle(resp.getOperationHandle());
+      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
+      return new OperationHandle(resp.getOperationHandle(), protocol);
     } catch (HiveSQLException e) {
       throw e;
     } catch (Exception e) {
@@ -284,7 +292,8 @@ public class ThriftCLIServiceClient exte
       req.setSchemaName(schemaName);
       TGetFunctionsResp resp = cliService.GetFunctions(req);
       checkStatus(resp.getStatus());
-      return new OperationHandle(resp.getOperationHandle());
+      TProtocolVersion protocol = sessionHandle.getProtocolVersion();
+      return new OperationHandle(resp.getOperationHandle(), protocol);
     } catch (HiveSQLException e) {
       throw e;
     } catch (Exception e) {
@@ -379,7 +388,7 @@ public class ThriftCLIServiceClient exte
       req.setMaxRows(maxRows);
       TFetchResultsResp resp = cliService.FetchResults(req);
       checkStatus(resp.getStatus());
-      return new RowSet(resp.getResults());
+      return RowSetFactory.create(resp.getResults(), opHandle.getProtocolVersion());
     } catch (HiveSQLException e) {
       throw e;
     } catch (Exception e) {

Modified: hive/trunk/service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java?rev=1554989&r1=1554988&r2=1554989&view=diff
==============================================================================
--- hive/trunk/service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java (original)
+++ hive/trunk/service/src/test/org/apache/hive/service/cli/thrift/ThriftCLIServiceTest.java Fri Jan  3 01:34:08 2014
@@ -357,8 +357,9 @@ public abstract class ThriftCLIServiceTe
     cliService.init(hconf);
     ThriftCLIService tcliService = new ThriftBinaryCLIService(cliService);
     TOpenSessionReq req = new TOpenSessionReq();
+    TOpenSessionResp res = new TOpenSessionResp();
     req.setUsername("testuser1");
-    SessionHandle sHandle = tcliService.getSessionHandle(req );
+    SessionHandle sHandle = tcliService.getSessionHandle(req, res);
     SessionManager sManager = getSessionManager(cliService.getServices());
     HiveSession session = sManager.getSession(sHandle);
 



Mime
View raw message