incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1201873 - in /incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces: QueryDescription.java WHColumnDescription.java WHQueryDescription.java WHTableStore.java
Date Mon, 14 Nov 2011 20:19:34 GMT
Author: kwright
Date: Mon Nov 14 20:19:34 2011
New Revision: 1201873

URL: http://svn.apache.org/viewvc?rev=1201873&view=rev
Log:
Flesh out how you specify aggregate columns.

Added:
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/QueryDescription.java
      - copied, changed from r1201833, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHQueryDescription.java
Removed:
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHColumnDescription.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHQueryDescription.java
Modified:
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTableStore.java

Copied: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/QueryDescription.java
(from r1201833, incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHQueryDescription.java)
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/QueryDescription.java?p2=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/QueryDescription.java&p1=incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHQueryDescription.java&r1=1201833&r2=1201873&rev=1201873&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHQueryDescription.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/QueryDescription.java
Mon Nov 14 20:19:34 2011
@@ -22,24 +22,76 @@ package org.apache.warthog.interfaces;
 /** This describes the return columns, source relations, and row criteria for a query.
 * NOTE: This is a transient structure.
 */
-public interface WHQueryDescription
+public class QueryDescription
 {
-  /** Get the return columns.  This may involve some manipulation of the results,
-  * including renaming of columns, mathematical calculations based on row data, etc.
+  protected WHColumnDescription[] returnColumns;
+  protected WHRelationship relationship;
+  protected String[] groupByColumns;
+  protected int offset;
+  protected int returnLimit;
+  
+  /** Constructor */
+  public QueryDescription(WHColumnDescription[] returnColumns, WHRelationship relationship,
+    String[] groupByColumns, int offset, int returnLimit)
+  {
+    this.returnColumns = returnColumns;
+    this.relationship = relationship;
+    this.groupByColumns = groupByColumns;
+    this.offset = offset;
+    this.returnLimit = returnLimit;
+  }
+  
+  /** Alternate constructor */
+  public QueryDescription(WHColumnDescription[] returnColumns, WHRelationship relationship,
+    String[] groupByColumns, int returnLimit)
+  {
+    this(returnColumns,relationship,groupByColumns,0,returnLimit);
+  }
+  
+  /** Alternate constructor */
+  public QueryDescription(WHColumnDescription[] returnColumns, WHRelationship relationship,
+    int returnLimit)
+  {
+    this(returnColumns,relationship,null,0,returnLimit);
+  }
+  
+  /** Alternate constructor */
+  public QueryDescription(WHColumnDescription[] returnColumns, WHRelationship relationship)
+  {
+    this(returnColumns,relationship,null,0,Integer.MAX_VALUE);
+  }
+  
+  /** Get return columns.
   */
-  //public WHColumn[] getReturnColumns();
+  public WHColumnDescription[] getReturnColumns()
+  {
+    return returnColumns;
+  }
   
-  // MHL.  Group-by and other operations that agglomerate rows need to be specified
-  // at this level.
+  /** Get the group-by column list.  The columns must be in the WHRelationship column names.
+  */
+  public String[] getGroupByColumns()
+  {
+    return groupByColumns;
+  }
   
   /** Get the source relationship (plus the accessor to get at it)
   */
-  public WHRelationship getRelationship();
+  public WHRelationship getRelationship()
+  {
+    return relationship;
+  }
   
   /** Get the starting result row number we're interested in. */
-  public int getOffset();
+  public int getOffset()
+  {
+    return offset;
+  }
   
   /** Get the maximum number of rows we are interested in. */
-  public int getReturnLimit();
+  public int getReturnLimit()
+  {
+    return returnLimit;
+  }
   
 }

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTableStore.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTableStore.java?rev=1201873&r1=1201872&r2=1201873&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTableStore.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/interfaces/WHTableStore.java
Mon Nov 14 20:19:34 2011
@@ -43,7 +43,7 @@ public interface WHTableStore
     throws WHException;
   
   /** Create a table */
-  public WHTable createTable(String name, WHColumnDescription[] columns)
+  public WHTable createTable(String name, String[] columnNames)
     throws WHException;
   
   /** Drop a table */
@@ -55,7 +55,7 @@ public interface WHTableStore
     throws WHException;
     
   /** Create an index */
-  public WHIndex createIndex(String name, String tableName, String[] columnNames, String[]
comparatorClasses)
+  public WHIndex createIndex(String name, String tableName, String[] columnNames, String[]
comparatorClasses, boolean unique)
     throws WHException;
     
   /** Drop an index */
@@ -63,7 +63,7 @@ public interface WHTableStore
     throws WHException;
     
   /** Perform a query */
-  public WHQueryResult performQuery(WHQueryDescription specification)
+  public WHQueryResult performQuery(QueryDescription specification)
     throws WHException;
     
 }



Mime
View raw message