Modified: 
hive/branches/spark/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
URL: 
http://svn.apache.org/viewvc/hive/branches/spark/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java?rev=1613740&r1=1613739&r2=1613740&view=diff
==============================================================================
--- 
hive/branches/spark/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
 (original)
+++ 
hive/branches/spark/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
 Sat Jul 26 23:45:46 2014
@@ -30,7 +30,6 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.Properties;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
@@ -54,6 +53,9 @@ class DatabaseConnection {
   private Schema schema = null;
   private Completor sqlCompletor = null;
 
+  public boolean isClosed() {
+    return (null == connection);
+  }
 
   public DatabaseConnection(BeeLine beeLine, String driver, String url,
        Properties info) throws SQLException {
@@ -101,15 +103,6 @@ class DatabaseConnection {
 
   /**
    * Connection to the specified data source.
-   *
-   * @param driver
-   *          the driver class
-   * @param url
-   *          the connection URL
-   * @param username
-   *          the username
-   * @param password
-   *          the password
    */
   boolean connect() throws SQLException {
     try {

Modified: 
hive/branches/spark/beeline/src/java/org/apache/hive/beeline/TableOutputFormat.java
URL: 
http://svn.apache.org/viewvc/hive/branches/spark/beeline/src/java/org/apache/hive/beeline/TableOutputFormat.java?rev=1613740&r1=1613739&r2=1613740&view=diff
==============================================================================
--- 
hive/branches/spark/beeline/src/java/org/apache/hive/beeline/TableOutputFormat.java
 (original)
+++ 
hive/branches/spark/beeline/src/java/org/apache/hive/beeline/TableOutputFormat.java
 Sat Jul 26 23:45:46 2014
@@ -49,7 +49,9 @@ class TableOutputFormat implements Outpu
     for (; rows.hasNext();) {
       Rows.Row row = (Rows.Row) rows.next();
       ColorBuffer cbuf = getOutputString(rows, row);
-      cbuf = cbuf.truncate(width);
+      if (beeLine.getOpts().getTruncateTable()) {
+        cbuf = cbuf.truncate(width);
+      }
 
       if (index == 0)  {
         sb.setLength(0);
@@ -61,9 +63,10 @@ class TableOutputFormat implements Outpu
         }
 
         headerCols = cbuf;
-        header = beeLine.getColorBuffer()
-            .green(sb.toString())
-            .truncate(headerCols.getVisibleLength());
+        header = beeLine.getColorBuffer().green(sb.toString());
+        if (beeLine.getOpts().getTruncateTable()) {
+          header = header.truncate(headerCols.getVisibleLength());
+        }
       }
 
       if (beeLine.getOpts().getShowHeader()) {

Modified: hive/branches/spark/beeline/src/main/resources/BeeLine.properties
URL: 
http://svn.apache.org/viewvc/hive/branches/spark/beeline/src/main/resources/BeeLine.properties?rev=1613740&r1=1613739&r2=1613740&view=diff
==============================================================================
--- hive/branches/spark/beeline/src/main/resources/BeeLine.properties (original)
+++ hive/branches/spark/beeline/src/main/resources/BeeLine.properties Sat Jul 
26 23:45:46 2014
@@ -167,6 +167,7 @@ cmd-usage: Usage: java org.apache.hive.c
 \  --silent=[true/false]           be more silent\n \
 \  --autosave=[true/false]         automatically save preferences\n \
 \  --outputformat=[table/vertical/csv/tsv]   format mode for result display\n \
+\  --truncateTable=[true/false]    truncate table column when it exceeds 
length\n \
 \  --isolation=LEVEL               set the transaction isolation level\n \
 \  --nullemptystring=[true/false]  set to true to get historic behavior of 
printing null as empty string\n \
 \  --help                          display this message

Modified: 
hive/branches/spark/beeline/src/test/org/apache/hive/beeline/TestBeelineArgParsing.java
URL: 
http://svn.apache.org/viewvc/hive/branches/spark/beeline/src/test/org/apache/hive/beeline/TestBeelineArgParsing.java?rev=1613740&r1=1613739&r2=1613740&view=diff
==============================================================================
--- 
hive/branches/spark/beeline/src/test/org/apache/hive/beeline/TestBeelineArgParsing.java
 (original)
+++ 
hive/branches/spark/beeline/src/test/org/apache/hive/beeline/TestBeelineArgParsing.java
 Sat Jul 26 23:45:46 2014
@@ -104,12 +104,14 @@ public class TestBeelineArgParsing {
   @Test
   public void testBeelineOpts() throws Exception {
     TestBeeline bl = new TestBeeline();
-    String args[] = new String[] {"-u", "url", "-n", "name",
-      "-p", "password", "-d", "driver", "--autoCommit=true", "--verbose"};
+    String args[] =
+        new String[] { "-u", "url", "-n", "name", "-p", "password", "-d", 
"driver",
+            "--autoCommit=true", "--verbose", "--truncateTable" };
     Assert.assertTrue(bl.initArgs(args));
     Assert.assertTrue(bl.connectArgs.equals("url name password driver"));
     Assert.assertTrue(bl.getOpts().getAutoCommit());
     Assert.assertTrue(bl.getOpts().getVerbose());
+    Assert.assertTrue(bl.getOpts().getTruncateTable());
   }
 
   /**

Modified: hive/branches/spark/bin/hive.cmd
URL: 
http://svn.apache.org/viewvc/hive/branches/spark/bin/hive.cmd?rev=1613740&r1=1613739&r2=1613740&view=diff
==============================================================================
--- hive/branches/spark/bin/hive.cmd (original)
+++ hive/branches/spark/bin/hive.cmd Sat Jul 26 23:45:46 2014
@@ -83,6 +83,12 @@ set AUX_PARAM=
                goto :ProcessCmdLine
        )
 
+       if %1==--orcfiledump (
+               set SERVICE=orcfiledump
+               shift
+               goto :ProcessCmdLine
+       )
+
        if %1==--help (
                set HELP=_help
                shift
@@ -339,6 +345,9 @@ goto :EOF
        set VAR%SERVICE_COUNT%=rcfilecat
 
        set /a SERVICE_COUNT = %SERVICE_COUNT% + 1
+       set VAR%SERVICE_COUNT%=orcfiledump
+
+       set /a SERVICE_COUNT = %SERVICE_COUNT% + 1
        set VAR%SERVICE_COUNT%=schematool
 goto :EOF
 

Modified: hive/branches/spark/common/pom.xml
URL: 
http://svn.apache.org/viewvc/hive/branches/spark/common/pom.xml?rev=1613740&r1=1613739&r2=1613740&view=diff
==============================================================================
--- hive/branches/spark/common/pom.xml (original)
+++ hive/branches/spark/common/pom.xml Sat Jul 26 23:45:46 2014
@@ -65,6 +65,11 @@
       <artifactId>commons-compress</artifactId>
       <version>${commons-compress.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.ant</groupId>
+      <artifactId>ant</artifactId>
+      <version>${ant.version}</version>
+    </dependency>
     <!-- test inter-project -->
     <dependency>
       <groupId>junit</groupId>
@@ -106,6 +111,14 @@
   </profiles>
 
   <build>
+    <resources>
+      <resource>
+        <directory>../conf/</directory>
+        <includes>
+          <include>hive-default.xml.template</include>
+        </includes>
+      </resource>
+    </resources>
     <sourceDirectory>${basedir}/src/java</sourceDirectory>
     <testSourceDirectory>${basedir}/src/test</testSourceDirectory>
     <scriptSourceDirectory>${basedir}/src/scripts</scriptSourceDirectory>
@@ -136,6 +149,21 @@
               <goal>run</goal>
             </goals>
           </execution>
+          <execution>
+            <id>generate-template</id>
+            <phase>package</phase>
+            <configuration>
+              <target>
+                <property name="compile.classpath" 
refid="maven.runtime.classpath"/>
+                <taskdef name="templategen" 
classname="org.apache.hadoop.hive.ant.GenHiveTemplate"
+                         classpath="${compile.classpath}"/>
+                <templategen 
templateFile="${basedir}/../conf/hive-default.xml.template"/>
+              </target>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
         </executions>
       </plugin>
       <plugin>


Reply via email to