incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [3/4] git commit: Adding fixes for thrift change and support for single and multi value blur columns.
Date Thu, 22 Jan 2015 03:40:54 GMT
Adding fixes for thrift change and support for single and multi value blur columns.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/71b5c5e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/71b5c5e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/71b5c5e5

Branch: refs/heads/master
Commit: 71b5c5e5c638bca3441fc21fa8d99a3bdf9331f9
Parents: 4e3073e
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Wed Jan 21 22:39:56 2015 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Wed Jan 21 22:39:56 2015 -0500

----------------------------------------------------------------------
 .../blur/analysis/ThriftFieldManager.java       |  4 +-
 .../java/org/apache/blur/thrift/TableAdmin.java | 15 ++--
 .../blur/manager/AliasBlurFilterCacheTest.java  |  2 +-
 .../apache/blur/server/TableContextTest.java    |  6 +-
 .../apache/blur/thrift/BlurClusterTestBase.java |  3 +-
 .../apache/blur/analysis/BaseFieldManager.java  | 79 ++++++++++++++------
 .../org/apache/blur/analysis/FieldManager.java  |  3 +-
 .../blur/analysis/FieldTypeDefinition.java      | 15 ++++
 .../apache/blur/analysis/HdfsFieldManager.java  | 11 ++-
 .../spatial/BaseSpatialFieldTypeDefinition.java | 12 ++-
 .../blur/analysis/BaseFieldManagerTest.java     | 49 ++++++++----
 .../blur/analysis/HdfsFieldManagerTest.java     | 14 ++--
 .../AclDiscoverFieldTypeDefinitionTest.java     |  4 +-
 .../type/AclReadFieldTypeDefinitionTest.java    |  4 +-
 ...yFieldTypeDefinitionGeohashDocValueTest.java |  2 +-
 ...eStrategyFieldTypeDefinitionGeohashTest.java |  5 +-
 ...eldTypeDefinitionQuadPrefixDocValueTest.java |  2 +-
 ...rategyFieldTypeDefinitionQuadPrefixTest.java |  2 +-
 ...yFieldTypeDefinitionGeohashDocValueTest.java |  2 +-
 ...eStrategyFieldTypeDefinitionGeohashTest.java |  2 +-
 ...eldTypeDefinitionQuadPrefixDocValueTest.java |  2 +-
 ...rategyFieldTypeDefinitionQuadPrefixTest.java |  2 +-
 .../blur/lucene/search/SuperParserTest.java     |  2 +-
 .../blur/shell/AddColumnDefinitionCommand.java  | 12 ++-
 24 files changed, 179 insertions(+), 75 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-core/src/main/java/org/apache/blur/analysis/ThriftFieldManager.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/analysis/ThriftFieldManager.java b/blur-core/src/main/java/org/apache/blur/analysis/ThriftFieldManager.java
index ca42330..70b8969 100644
--- a/blur-core/src/main/java/org/apache/blur/analysis/ThriftFieldManager.java
+++ b/blur-core/src/main/java/org/apache/blur/analysis/ThriftFieldManager.java
@@ -55,6 +55,7 @@ public class ThriftFieldManager extends BaseFieldManager {
     columnDefinition.setProperties(fieldTypeDefinition.getProperties());
     columnDefinition.setSortable(fieldTypeDefinition.isSortEnable());
     columnDefinition.setSubColumnName(fieldTypeDefinition.getSubColumnName());
+    columnDefinition.setMultiValueField(fieldTypeDefinition.isMultiValueField());
 
     try {
       return _client.addColumnDefinition(_table, columnDefinition);
@@ -82,11 +83,12 @@ public class ThriftFieldManager extends BaseFieldManager {
           if (field.equals(fieldName)) {
             boolean fieldLessIndexing = columnDefinition.isFieldLessIndexed();
             boolean sortenabled = columnDefinition.isSortable();
+            boolean multiValueField = columnDefinition.isMultiValueField();
             Map<String, String> props = columnDefinition.getProperties();
 
             String fieldType = columnDefinition.getFieldType();
             FieldTypeDefinition fieldTypeDefinition = newFieldTypeDefinition(fieldName, fieldLessIndexing, fieldType,
-                sortenabled, props);
+                sortenabled, multiValueField, props);
             fieldTypeDefinition.setFamily(columnDefinition.getFamily());
             fieldTypeDefinition.setColumnName(columnDefinition.getColumnName());
             fieldTypeDefinition.setSubColumnName(columnDefinition.getSubColumnName());

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-core/src/main/java/org/apache/blur/thrift/TableAdmin.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/thrift/TableAdmin.java b/blur-core/src/main/java/org/apache/blur/thrift/TableAdmin.java
index 7a0e724..588c87c 100644
--- a/blur-core/src/main/java/org/apache/blur/thrift/TableAdmin.java
+++ b/blur-core/src/main/java/org/apache/blur/thrift/TableAdmin.java
@@ -447,9 +447,10 @@ public abstract class TableAdmin implements Iface {
     }
     boolean sortable = columnDefinition.isSortable();
     Map<String, String> props = columnDefinition.getProperties();
+    boolean multiValueField = columnDefinition.isMultiValueField();
     try {
       return fieldManager.addColumnDefinition(family, columnName, subColumnName, fieldLessIndexed, fieldType, sortable,
-          props);
+          multiValueField, props);
     } catch (IOException e) {
       throw new BException(
           "Unknown error while trying to addColumnDefinition on table [{0}] with columnDefinition [{1}]", e, table,
@@ -583,6 +584,7 @@ public abstract class TableAdmin implements Iface {
     columnDefinition.setFieldType(fieldTypeDefinition.getFieldType());
     columnDefinition.setSortable(fieldTypeDefinition.isSortEnable());
     columnDefinition.setProperties(fieldTypeDefinition.getProperties());
+    columnDefinition.setMultiValueField(fieldTypeDefinition.isMultiValueField());
     return columnDefinition;
   }
 
@@ -712,10 +714,11 @@ public abstract class TableAdmin implements Iface {
     // TODO Start transaction here...
   }
 
-//  @Override
-//  public void bulkMutateFinish(String bulkId, boolean apply, boolean blockUntilComplete) throws BlurException,
-//      TException {
-//    throw new RuntimeException("Not implemented.");
-//  }
+  // @Override
+  // public void bulkMutateFinish(String bulkId, boolean apply, boolean
+  // blockUntilComplete) throws BlurException,
+  // TException {
+  // throw new RuntimeException("Not implemented.");
+  // }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-core/src/test/java/org/apache/blur/manager/AliasBlurFilterCacheTest.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/manager/AliasBlurFilterCacheTest.java b/blur-core/src/test/java/org/apache/blur/manager/AliasBlurFilterCacheTest.java
index d253c68..3907f19 100644
--- a/blur-core/src/test/java/org/apache/blur/manager/AliasBlurFilterCacheTest.java
+++ b/blur-core/src/test/java/org/apache/blur/manager/AliasBlurFilterCacheTest.java
@@ -111,7 +111,7 @@ public class AliasBlurFilterCacheTest {
       }
     };
 
-    fieldManager.addColumnDefinition(null, "bin", null, false, "string", false, null);
+    fieldManager.addColumnDefinition(null, "bin", null, false, "string", false, false, null);
     fieldManager.addColumnDefinitionInt("a", "id_i");
     fieldManager.addColumnDefinitionDouble("a", "id_d");
     fieldManager.addColumnDefinitionFloat("a", "id_f");

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-core/src/test/java/org/apache/blur/server/TableContextTest.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/server/TableContextTest.java b/blur-core/src/test/java/org/apache/blur/server/TableContextTest.java
index 52d57d9..8182a7e 100644
--- a/blur-core/src/test/java/org/apache/blur/server/TableContextTest.java
+++ b/blur-core/src/test/java/org/apache/blur/server/TableContextTest.java
@@ -54,7 +54,7 @@ public class TableContextTest {
 
     FieldManager fieldManager = context.getFieldManager();
     try {
-      boolean result = fieldManager.addColumnDefinition("fam", "col", null, false, "test", false, null);
+      boolean result = fieldManager.addColumnDefinition("fam", "col", null, false, "test", false, false, null);
       fail("should fail because new type is not loaded [" + result + "].");
     } catch (IllegalArgumentException e) {
 
@@ -71,7 +71,7 @@ public class TableContextTest {
     TableContext context = TableContext.create(tableDescriptor);
     FieldManager fieldManager = context.getFieldManager();
 
-    fieldManager.addColumnDefinition("fam", "col", null, false, "test", false, null);
+    fieldManager.addColumnDefinition("fam", "col", null, false, "test", false, false, null);
   }
 
   @Test
@@ -88,7 +88,7 @@ public class TableContextTest {
     TableContext context = TableContext.create(tableDescriptor);
     FieldManager fieldManager = context.getFieldManager();
 
-    fieldManager.addColumnDefinition("fam", "col", null, false, "test", false, null);
+    fieldManager.addColumnDefinition("fam", "col", null, false, "test", false, false, null);
   }
 
   private void rm(File file) {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTestBase.java
----------------------------------------------------------------------
diff --git a/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTestBase.java b/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTestBase.java
index edbca2a..a52e81d 100644
--- a/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTestBase.java
+++ b/blur-core/src/test/java/org/apache/blur/thrift/BlurClusterTestBase.java
@@ -242,7 +242,8 @@ public abstract class BlurClusterTestBase {
     TableContext tableContext = TableContext.create(client.describe(tableName));
     FieldManager fieldManager = tableContext.getFieldManager();
 
-    assertTrue(fieldManager.addColumnDefinition("test-family", "test-column", null, false, "string", false, null));
+    assertTrue(fieldManager
+        .addColumnDefinition("test-family", "test-column", null, false, "string", false, false, null));
 
     TableContext.clear();
     Schema newschema = client.schema(tableName);

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/main/java/org/apache/blur/analysis/BaseFieldManager.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/BaseFieldManager.java b/blur-query/src/main/java/org/apache/blur/analysis/BaseFieldManager.java
index 1bf8a24..f4f8f6e 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/BaseFieldManager.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/BaseFieldManager.java
@@ -65,7 +65,8 @@ import org.apache.lucene.search.SortField;
 public abstract class BaseFieldManager extends FieldManager {
 
   private static final Log LOG = LogFactory.getLog(BaseFieldManager.class);
-  private static final Map<String, String> EMPTY_MAP = new HashMap<String, String>();;
+  private static final Map<String, String> EMPTY_MAP = new HashMap<String, String>();
+  private static final boolean DEFAULT_MULTI_VALUE_FIELD_VALUE = true;
 
   private final ConcurrentMap<String, Set<String>> _columnToSubColumn = new ConcurrentHashMap<String, Set<String>>();
   private final ConcurrentMap<String, FieldTypeDefinition> _fieldNameToDefMap = new ConcurrentHashMap<String, FieldTypeDefinition>();
@@ -225,6 +226,7 @@ public abstract class BaseFieldManager extends FieldManager {
     List<Column> columns = record.getColumns();
     addDefaultFields(fields, rowId, record);
     addFieldExistance(fields, record);
+    Map<String, Integer> fieldCounts = new HashMap<String, Integer>();
     for (Column column : columns) {
       String name = column.getName();
       String value = column.getValue();
@@ -238,15 +240,30 @@ public abstract class BaseFieldManager extends FieldManager {
           throw new IOException("Family [" + family + "] Column [" + column + "] not defined");
         }
         addColumnDefinition(family, name, null, getDefaultMissingFieldLessIndexing(), getDefaultMissingFieldType(),
-            false, getDefaultMissingFieldProps());
+            false, DEFAULT_MULTI_VALUE_FIELD_VALUE, getDefaultMissingFieldProps());
         fieldTypeDefinition = getFieldTypeDefinition(family, column);
       }
-      getAndAddFields(fields, family, column, fieldTypeDefinition);
+      String fieldName = fieldTypeDefinition.getFieldName();
+      Integer count = fieldCounts.get(fieldName);
+      if (count == null) {
+        count = 1;
+      } else {
+        count = count + 1;
+      }
+      fieldCounts.put(fieldName, count);
+      getAndAddFields(fields, family, column, fieldTypeDefinition, count);
       Collection<String> subColumns = getSubColumns(family, column);
       if (subColumns != null) {
         for (String subName : subColumns) {
           FieldTypeDefinition subFieldTypeDefinition = getFieldTypeDefinition(family, column, subName);
-          getAndAddFields(fields, family, column, subName, subFieldTypeDefinition);
+          fieldName = subFieldTypeDefinition.getFieldName();
+          count = fieldCounts.get(fieldName);
+          if (count == null) {
+            count = 1;
+          } else {
+            count = count + 1;
+          }
+          getAndAddFields(fields, family, column, subName, subFieldTypeDefinition, count);
         }
       }
     }
@@ -277,7 +294,11 @@ public abstract class BaseFieldManager extends FieldManager {
   }
 
   private void getAndAddFields(List<Field> fields, String family, Column column, String subName,
-      FieldTypeDefinition fieldTypeDefinition) {
+      FieldTypeDefinition fieldTypeDefinition, int count) throws IOException {
+    if (count > 1 && !fieldTypeDefinition.isMultiValueField()) {
+      throw new IOException("Field [" + fieldTypeDefinition.getFieldName()
+          + "] does not allow more than one column value.");
+    }
     for (Field field : fieldTypeDefinition.getFieldsForSubColumn(family, column, subName)) {
       fields.add(field);
     }
@@ -306,7 +327,12 @@ public abstract class BaseFieldManager extends FieldManager {
     throw new IllegalArgumentException("Field [" + fieldName + "] cannot be null.");
   }
 
-  private void getAndAddFields(List<Field> fields, String family, Column column, FieldTypeDefinition fieldTypeDefinition) {
+  private void getAndAddFields(List<Field> fields, String family, Column column,
+      FieldTypeDefinition fieldTypeDefinition, int count) throws IOException {
+    if (count > 1 && !fieldTypeDefinition.isMultiValueField()) {
+      throw new IOException("Field [" + fieldTypeDefinition.getFieldName()
+          + "] does not allow more than one column value.");
+    }
     for (Field field : fieldTypeDefinition.getFieldsForColumn(family, column)) {
       fields.add(field);
     }
@@ -345,7 +371,7 @@ public abstract class BaseFieldManager extends FieldManager {
 
   @Override
   public boolean addColumnDefinition(String family, String columnName, String subColumnName, boolean fieldLessIndexed,
-      String fieldType, boolean sortable, Map<String, String> props) throws IOException {
+      String fieldType, boolean sortable, boolean multiValueField, Map<String, String> props) throws IOException {
     if (family == null) {
       family = BlurConstants.DEFAULT_FAMILY;
     }
@@ -366,16 +392,18 @@ public abstract class BaseFieldManager extends FieldManager {
       fieldName = baseFieldName;
     }
     return addFieldTypeDefinition(family, columnName, subColumnName, fieldName, fieldLessIndexed, fieldType, sortable,
-        props);
+        multiValueField, props);
   }
 
   private boolean addFieldTypeDefinition(String family, String columnName, String subColumnName, String fieldName,
-      boolean fieldLessIndexed, String fieldType, boolean sortable, Map<String, String> props) throws IOException {
+      boolean fieldLessIndexed, String fieldType, boolean sortable, boolean multiValueField, Map<String, String> props)
+      throws IOException {
     FieldTypeDefinition fieldTypeDefinition = getFieldTypeDefinition(fieldName);
     if (fieldTypeDefinition != null) {
       return false;
     }
-    fieldTypeDefinition = newFieldTypeDefinition(fieldName, fieldLessIndexed, fieldType, sortable, props);
+    fieldTypeDefinition = newFieldTypeDefinition(fieldName, fieldLessIndexed, fieldType, sortable, multiValueField,
+        props);
     synchronized (_fieldNameToDefMap) {
       for (String alternateFieldName : fieldTypeDefinition.getAlternateFieldNames()) {
         if (_fieldNameToDefMap.containsKey(alternateFieldName)) {
@@ -434,7 +462,7 @@ public abstract class BaseFieldManager extends FieldManager {
   }
 
   protected FieldTypeDefinition newFieldTypeDefinition(String fieldName, boolean fieldLessIndexed, String fieldType,
-      boolean sortable, Map<String, String> props) {
+      boolean sortable, boolean multiValueField, Map<String, String> props) {
     if (fieldType == null) {
       throw new IllegalArgumentException("Field type can not be null.");
     }
@@ -459,6 +487,7 @@ public abstract class BaseFieldManager extends FieldManager {
     }
     fieldTypeDefinition.setSortEnable(sortable);
     fieldTypeDefinition.setFieldLessIndexed(fieldLessIndexed);
+    fieldTypeDefinition.setMultiValueField(multiValueField);
     return fieldTypeDefinition;
   }
 
@@ -502,48 +531,56 @@ public abstract class BaseFieldManager extends FieldManager {
 
   public void addColumnDefinitionGisPointVector(String family, String columnName) throws IOException {
     addColumnDefinition(family, columnName, null, false, SpatialPointVectorStrategyFieldTypeDefinition.NAME, false,
-        null);
+        false, null);
   }
 
   public void addColumnDefinitionGisRecursivePrefixTree(String family, String columnName) throws IOException {
     Map<String, String> props = new HashMap<String, String>();
     props.put(BaseSpatialFieldTypeDefinition.SPATIAL_PREFIX_TREE, BaseSpatialFieldTypeDefinition.GEOHASH_PREFIX_TREE);
     addColumnDefinition(family, columnName, null, false, SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.NAME,
-        false, props);
+        false, false, props);
   }
 
   public void addColumnDefinitionDate(String family, String columnName, String format) throws IOException {
     Map<String, String> props = new HashMap<String, String>();
     props.put(DateFieldTypeDefinition.DATE_FORMAT, format);
-    addColumnDefinition(family, columnName, null, false, DateFieldTypeDefinition.NAME, false, props);
+    addColumnDefinition(family, columnName, null, false, DateFieldTypeDefinition.NAME, false,
+        DEFAULT_MULTI_VALUE_FIELD_VALUE, props);
   }
 
   public void addColumnDefinitionInt(String family, String columnName) throws IOException {
-    addColumnDefinition(family, columnName, null, false, IntFieldTypeDefinition.NAME, false, null);
+    addColumnDefinition(family, columnName, null, false, IntFieldTypeDefinition.NAME, false,
+        DEFAULT_MULTI_VALUE_FIELD_VALUE, null);
   }
 
   public void addColumnDefinitionLong(String family, String columnName) throws IOException {
-    addColumnDefinition(family, columnName, null, false, LongFieldTypeDefinition.NAME, false, null);
+    addColumnDefinition(family, columnName, null, false, LongFieldTypeDefinition.NAME, false,
+        DEFAULT_MULTI_VALUE_FIELD_VALUE, null);
   }
 
   public void addColumnDefinitionFloat(String family, String columnName) throws IOException {
-    addColumnDefinition(family, columnName, null, false, FloatFieldTypeDefinition.NAME, false, null);
+    addColumnDefinition(family, columnName, null, false, FloatFieldTypeDefinition.NAME, false,
+        DEFAULT_MULTI_VALUE_FIELD_VALUE, null);
   }
 
   public void addColumnDefinitionDouble(String family, String columnName) throws IOException {
-    addColumnDefinition(family, columnName, null, false, DoubleFieldTypeDefinition.NAME, false, null);
+    addColumnDefinition(family, columnName, null, false, DoubleFieldTypeDefinition.NAME, false,
+        DEFAULT_MULTI_VALUE_FIELD_VALUE, null);
   }
 
   public void addColumnDefinitionString(String family, String columnName) throws IOException {
-    addColumnDefinition(family, columnName, null, false, StringFieldTypeDefinition.NAME, false, null);
+    addColumnDefinition(family, columnName, null, false, StringFieldTypeDefinition.NAME, false,
+        DEFAULT_MULTI_VALUE_FIELD_VALUE, null);
   }
 
   public void addColumnDefinitionText(String family, String columnName) throws IOException {
-    addColumnDefinition(family, columnName, null, false, TextFieldTypeDefinition.NAME, false, null);
+    addColumnDefinition(family, columnName, null, false, TextFieldTypeDefinition.NAME, false,
+        DEFAULT_MULTI_VALUE_FIELD_VALUE, null);
   }
 
   public void addColumnDefinitionTextFieldLess(String family, String columnName) throws IOException {
-    addColumnDefinition(family, columnName, null, true, TextFieldTypeDefinition.NAME, false, null);
+    addColumnDefinition(family, columnName, null, true, TextFieldTypeDefinition.NAME, false,
+        DEFAULT_MULTI_VALUE_FIELD_VALUE, null);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/main/java/org/apache/blur/analysis/FieldManager.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/FieldManager.java b/blur-query/src/main/java/org/apache/blur/analysis/FieldManager.java
index 217d0cf..6dd70b2 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/FieldManager.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/FieldManager.java
@@ -61,13 +61,14 @@ public abstract class FieldManager {
    *          the field type name, required.
    * @param sortable
    *          makes this column sortable.
+   * @param multiValueField 
    * @param props
    *          the configuration properties for this column and type.
    * @return
    * @throws IOException
    */
   public abstract boolean addColumnDefinition(String family, String columnName, String subColumnName,
-      boolean fieldLessIndexed, String fieldType, boolean sortable, Map<String, String> props) throws IOException;
+      boolean fieldLessIndexed, String fieldType, boolean sortable, boolean multiValueField, Map<String, String> props) throws IOException;
 
   /**
    * Gets the analyzer for the indexing process.

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/main/java/org/apache/blur/analysis/FieldTypeDefinition.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/FieldTypeDefinition.java b/blur-query/src/main/java/org/apache/blur/analysis/FieldTypeDefinition.java
index bd82b64..11a2819 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/FieldTypeDefinition.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/FieldTypeDefinition.java
@@ -38,6 +38,7 @@ public abstract class FieldTypeDefinition {
   private String _subColumnName;
   private String _fieldType;
   private Map<String, String> _properties;
+  private boolean _multiValueField;
 
   /**
    * Gets the name of the field type.
@@ -192,6 +193,9 @@ public abstract class FieldTypeDefinition {
     if (sortEnable && !checkSupportForSorting()) {
       throw new RuntimeException("Field type [" + getName() + "] is not sortable.");
     }
+    if (sortEnable && isMultiValueField()) {
+      throw new RuntimeException("Field type [" + getName() + "] can not be sortable and multi valued.");
+    }
     _sortEnable = sortEnable;
   }
 
@@ -241,4 +245,15 @@ public abstract class FieldTypeDefinition {
 
   public abstract SortField getSortField(boolean reverse);
 
+  public void setMultiValueField(boolean multiValueField) {
+    if (multiValueField && isSortEnable()) {
+      throw new RuntimeException("Field type [" + getName() + "] can not be sortable and multi valued.");
+    }
+    _multiValueField = multiValueField;
+  }
+
+  public boolean isMultiValueField() {
+    return _multiValueField;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/main/java/org/apache/blur/analysis/HdfsFieldManager.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/HdfsFieldManager.java b/blur-query/src/main/java/org/apache/blur/analysis/HdfsFieldManager.java
index 1768deb..bef55b4 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/HdfsFieldManager.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/HdfsFieldManager.java
@@ -50,12 +50,13 @@ public class HdfsFieldManager extends BaseFieldManager {
   private static final String FIELD_TYPE = "_fieldType_";
   private static final String FIELD_LESS_INDEXING = "_fieldLessIndexing_";
   private static final String SORTENABLED = "_sortEnabled_";
+  private static final String MULTI_VALUE_FIELD = "_multiValueField_";
   private static final String FAMILY = "_family_";
   private static final String COLUMN_NAME = "_columnName_";
   private static final String SUB_COLUMN_NAME = "_subColumnName_";
   private static final String TYPE_FILE_EXT = ".type";
 
-  private static final Lock _lock =  new ReentrantReadWriteLock().writeLock();
+  private static final Lock _lock = new ReentrantReadWriteLock().writeLock();
 
   private final Configuration _configuration;
   private final Path _storagePath;
@@ -119,6 +120,7 @@ public class HdfsFieldManager extends BaseFieldManager {
         String fieldType = fieldTypeDefinition.getFieldType();
         boolean fieldLessIndexed = fieldTypeDefinition.isFieldLessIndexed();
         boolean sortEnable = fieldTypeDefinition.isSortEnable();
+        boolean multiValueField = fieldTypeDefinition.isMultiValueField();
         LOG.info(
             "Attempting to store new field [{0}] with fieldLessIndexing [{1}] with type [{2}] and properties [{3}]",
             fieldName, fieldLessIndexed, fieldType, fieldTypeDefinition.getProperties());
@@ -129,6 +131,7 @@ public class HdfsFieldManager extends BaseFieldManager {
         setProperty(properties, SUB_COLUMN_NAME, fieldTypeDefinition.getSubColumnName());
         setProperty(properties, FIELD_LESS_INDEXING, Boolean.toString(fieldLessIndexed));
         setProperty(properties, SORTENABLED, Boolean.toString(sortEnable));
+        setProperty(properties, MULTI_VALUE_FIELD, Boolean.toString(multiValueField));
 
         setProperty(properties, FIELD_TYPE, fieldType);
         Map<String, String> props = fieldTypeDefinition.getProperties();
@@ -192,15 +195,18 @@ public class HdfsFieldManager extends BaseFieldManager {
       inputStream.close();
       boolean fieldLessIndexing = Boolean.parseBoolean(properties.getProperty(FIELD_LESS_INDEXING));
       boolean sortenabled = Boolean.parseBoolean(properties.getProperty(SORTENABLED));
+      boolean multiValueField = Boolean.parseBoolean(properties.getProperty(MULTI_VALUE_FIELD));
       String fieldType = properties.getProperty(FIELD_TYPE);
       Map<String, String> props = toMap(properties);
       FieldTypeDefinition fieldTypeDefinition = newFieldTypeDefinition(fieldName, fieldLessIndexing, fieldType,
-          sortenabled, props);
+          sortenabled, multiValueField, props);
       fieldTypeDefinition.setFamily(properties.getProperty(FAMILY));
       fieldTypeDefinition.setColumnName(properties.getProperty(COLUMN_NAME));
       fieldTypeDefinition.setSubColumnName(properties.getProperty(SUB_COLUMN_NAME));
       fieldTypeDefinition.setFieldLessIndexed(fieldLessIndexing);
       fieldTypeDefinition.setFieldType(properties.getProperty(FIELD_TYPE));
+      fieldTypeDefinition.setSortEnable(sortenabled);
+      fieldTypeDefinition.setMultiValueField(multiValueField);
       fieldTypeDefinition.setProperties(props);
       registerFieldTypeDefinition(fieldName, fieldTypeDefinition);
     } finally {
@@ -219,6 +225,7 @@ public class HdfsFieldManager extends BaseFieldManager {
     result.remove(FIELD_TYPE);
     result.remove(FIELD_LESS_INDEXING);
     result.remove(SORTENABLED);
+    result.remove(MULTI_VALUE_FIELD);
     return result;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/main/java/org/apache/blur/analysis/type/spatial/BaseSpatialFieldTypeDefinition.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/type/spatial/BaseSpatialFieldTypeDefinition.java b/blur-query/src/main/java/org/apache/blur/analysis/type/spatial/BaseSpatialFieldTypeDefinition.java
index 1dcc1f5..560c5ca 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/type/spatial/BaseSpatialFieldTypeDefinition.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/type/spatial/BaseSpatialFieldTypeDefinition.java
@@ -92,7 +92,7 @@ public abstract class BaseSpatialFieldTypeDefinition extends CustomFieldTypeDefi
     SpatialArgs args = SpatialArgsParser.parse(text, _shapeReadWriter);
     checkSpatialArgs(args);
     synchronized (_strategy) {
-      return _strategy.makeQuery(args);  
+      return _strategy.makeQuery(args);
     }
   }
 
@@ -172,4 +172,14 @@ public abstract class BaseSpatialFieldTypeDefinition extends CustomFieldTypeDefi
     }
     _supportedIndexedShapes.add(c);
   }
+
+  @Override
+  public void setMultiValueField(boolean multiValueField) {
+    if (!multiValueField) {
+      super.setMultiValueField(multiValueField);
+    } else {
+      throw new RuntimeException("Field type [" + getName() + "] can not multi valued.");
+    }
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/BaseFieldManagerTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/BaseFieldManagerTest.java b/blur-query/src/test/java/org/apache/blur/analysis/BaseFieldManagerTest.java
index 362dc07..f4051e4 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/BaseFieldManagerTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/BaseFieldManagerTest.java
@@ -41,7 +41,7 @@ public class BaseFieldManagerTest {
   @Test
   public void testFieldManager() throws IOException {
     FieldManager memoryFieldManager = newFieldManager(true);
-    memoryFieldManager.addColumnDefinition("fam1", "col1", null, true, "text", false, null);
+    memoryFieldManager.addColumnDefinition("fam1", "col1", null, true, "text", false, false, null);
 
     Record record = new Record();
     record.setFamily("fam1");
@@ -64,7 +64,7 @@ public class BaseFieldManagerTest {
   @Test
   public void testFieldManagerWithNullFamily() throws IOException {
     FieldManager memoryFieldManager = newFieldManager(true);
-    memoryFieldManager.addColumnDefinition(null, "col1", null, true, "text", false, null);
+    memoryFieldManager.addColumnDefinition(null, "col1", null, true, "text", false, false, null);
 
     Record record = new Record();
     record.setRecordId("1213");
@@ -82,7 +82,7 @@ public class BaseFieldManagerTest {
   @Test
   public void testFieldManagerMultipleColumnsSameName() throws IOException {
     FieldManager memoryFieldManager = newFieldManager(true);
-    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, null);
+    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, true, null);
 
     Record record = new Record();
     record.setFamily("fam1");
@@ -96,17 +96,36 @@ public class BaseFieldManagerTest {
 
     int c = 0;
     for (Field field : memoryFieldManager.getFields("1", record)) {
-//      assertFieldEquals(fields.get(c++), field);
+      // assertFieldEquals(fields.get(c++), field);
       System.out.println("Should be [" + fields.get(c++) + "] was [" + field + "]");
     }
 
   }
 
   @Test
+  public void testFieldManagerMultipleColumnsSameNameWhenNotAllowed() throws IOException {
+    FieldManager memoryFieldManager = newFieldManager(true);
+    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, false, null);
+
+    Record record = new Record();
+    record.setFamily("fam1");
+    record.setRecordId("1213");
+    record.addToColumns(new Column("col1", "value1"));
+    record.addToColumns(new Column("col1", "value2"));
+
+    try {
+      memoryFieldManager.getFields("1", record);
+      fail();
+    } catch (IOException ex) {
+      assertEquals("Field [fam1.col1] does not allow more than one column value.", ex.getMessage());
+    }
+  }
+
+  @Test
   public void testFieldManagerMultipleColumnsDifferentNames() throws IOException {
     FieldManager memoryFieldManager = newFieldManager(true);
-    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, null);
-    memoryFieldManager.addColumnDefinition("fam1", "col2", null, true, "text", false, null);
+    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, false, null);
+    memoryFieldManager.addColumnDefinition("fam1", "col2", null, true, "text", false, false, null);
 
     Record record = new Record();
     record.setFamily("fam1");
@@ -128,8 +147,8 @@ public class BaseFieldManagerTest {
   @Test
   public void testFieldManagerMultipleColumnsDifferentNamesDifferentFamilies() throws IOException {
     FieldManager memoryFieldManager = newFieldManager(true);
-    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, null);
-    memoryFieldManager.addColumnDefinition("fam2", "col2", null, false, "text", false, null);
+    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, false, null);
+    memoryFieldManager.addColumnDefinition("fam2", "col2", null, false, "text", false, false, null);
 
     Record record1 = new Record();
     record1.setFamily("fam1");
@@ -159,8 +178,8 @@ public class BaseFieldManagerTest {
   @Test
   public void testFieldManagerMultipleColumnsDifferentNamesNullFamilies() throws IOException {
     FieldManager memoryFieldManager = newFieldManager(true);
-    memoryFieldManager.addColumnDefinition(null, "col1", null, false, "text", false, null);
-    memoryFieldManager.addColumnDefinition(null, "col2", null, false, "text", false, null);
+    memoryFieldManager.addColumnDefinition(null, "col1", null, false, "text", false, false, null);
+    memoryFieldManager.addColumnDefinition(null, "col2", null, false, "text", false, false, null);
 
     Record record1 = new Record();
     record1.setRecordId("1213");
@@ -191,7 +210,7 @@ public class BaseFieldManagerTest {
   public void testFieldManagerSubNameWithMainColumnNameNoParent() throws IOException {
     FieldManager memoryFieldManager = newFieldManager(true);
     try {
-      memoryFieldManager.addColumnDefinition("fam1", "col1", "sub1", false, "text", false, null);
+      memoryFieldManager.addColumnDefinition("fam1", "col1", "sub1", false, "text", false, false, null);
       fail("Should throw IllegalArgumentException");
     } catch (IllegalArgumentException e) {
     }
@@ -200,9 +219,9 @@ public class BaseFieldManagerTest {
   @Test
   public void testFieldManagerSubNameWithMainColumnNameNoFieldLess() throws IOException {
     FieldManager memoryFieldManager = newFieldManager(true);
-    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, null);
+    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, false, null);
     try {
-      memoryFieldManager.addColumnDefinition("fam1", "col1", "sub1", true, "text", false, null);
+      memoryFieldManager.addColumnDefinition("fam1", "col1", "sub1", true, "text", false, false, null);
       fail("Should throw IllegalArgumentException");
     } catch (IllegalArgumentException e) {
     }
@@ -211,8 +230,8 @@ public class BaseFieldManagerTest {
   @Test
   public void testFieldManagerSubName() throws IOException {
     FieldManager memoryFieldManager = newFieldManager(true);
-    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, null);
-    memoryFieldManager.addColumnDefinition("fam1", "col1", "sub1", false, "text", false, null);
+    memoryFieldManager.addColumnDefinition("fam1", "col1", null, false, "text", false, false, null);
+    memoryFieldManager.addColumnDefinition("fam1", "col1", "sub1", false, "text", false, false, null);
 
     Record record = new Record();
     record.setRecordId("1213");

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/HdfsFieldManagerTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/HdfsFieldManagerTest.java b/blur-query/src/test/java/org/apache/blur/analysis/HdfsFieldManagerTest.java
index b1df816..d84dec3 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/HdfsFieldManagerTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/HdfsFieldManagerTest.java
@@ -52,7 +52,7 @@ public class HdfsFieldManagerTest extends BaseFieldManagerTest {
   @Test
   public void fieldManagerShouldIgnoreUnknownFiles() throws IOException {
     BaseFieldManager fieldManager = newFieldManager(true);
-    fieldManager.addColumnDefinition("unknowntest", "col1", null, true, "text", false, null);
+    fieldManager.addColumnDefinition("unknowntest", "col1", null, true, "text", false, false, null);
     FieldTypeDefinition fieldTypeDefinition1 = fieldManager.getFieldTypeDefinition("unknowntest.col1");
 
     assertNotNull(fieldTypeDefinition1);
@@ -70,7 +70,7 @@ public class HdfsFieldManagerTest extends BaseFieldManagerTest {
   @Test
   public void columnsWithNamesSimilarToOurSuffixShouldntCauseProblems() throws IOException {
     BaseFieldManager fieldManager = newFieldManager(true);
-    fieldManager.addColumnDefinition("similartest", "typeFoo", null, true, "text", false, null);
+    fieldManager.addColumnDefinition("similartest", "typeFoo", null, true, "text", false, false, null);
     FieldTypeDefinition fieldTypeDefinition1 = fieldManager.getFieldTypeDefinition("similartest.typeFoo");
 
     assertNotNull(fieldTypeDefinition1);
@@ -96,11 +96,11 @@ public class HdfsFieldManagerTest extends BaseFieldManagerTest {
   @Test
   public void testStoreMetaData() throws IOException {
     BaseFieldManager memoryFieldManager = newFieldManager(true);
-    memoryFieldManager.addColumnDefinition("fam1", "col1", null, true, "text", false, null);
-    memoryFieldManager.addColumnDefinition("fam2", "col2", null, false, "string", true, null);
-    memoryFieldManager.addColumnDefinition("fam2", "col2", "a", false, "text", false, null);
-    memoryFieldManager.addColumnDefinition("fam2", "col2", "b", false, "text", false, newMap(e("a", "b")));
-    memoryFieldManager.addColumnDefinition("fam2", "col3", null, false, "int", false, null);
+    memoryFieldManager.addColumnDefinition("fam1", "col1", null, true, "text", false, false, null);
+    memoryFieldManager.addColumnDefinition("fam2", "col2", null, false, "string", true, false, null);
+    memoryFieldManager.addColumnDefinition("fam2", "col2", "a", false, "text", false, false, null);
+    memoryFieldManager.addColumnDefinition("fam2", "col2", "b", false, "text", false, false, newMap(e("a", "b")));
+    memoryFieldManager.addColumnDefinition("fam2", "col3", null, false, "int", false, false, null);
 
     BaseFieldManager memoryFieldManager2 = newFieldManager(false);
     FieldTypeDefinition fieldTypeDefinition1 = memoryFieldManager2.getFieldTypeDefinition("fam1.col1");

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinitionTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinitionTest.java b/blur-query/src/test/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinitionTest.java
index 70cc79b..19e27cd 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinitionTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/AclDiscoverFieldTypeDefinitionTest.java
@@ -145,8 +145,8 @@ public class AclDiscoverFieldTypeDefinitionTest {
   }
 
   private void setupFieldManager(BaseFieldManager fieldManager) throws IOException {
-    fieldManager.addColumnDefinition(FAM, "string", null, false, "string", false, null);
-    fieldManager.addColumnDefinition(FAM, "discover", null, false, "acl-discover", false, null);
+    fieldManager.addColumnDefinition(FAM, "string", null, false, "string", false, false, null);
+    fieldManager.addColumnDefinition(FAM, "discover", null, false, "acl-discover", false, false, null);
   }
 
   protected BaseFieldManager getFieldManager(Analyzer a) throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinitionTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinitionTest.java b/blur-query/src/test/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinitionTest.java
index 4bf42ae..c221367 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinitionTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/AclReadFieldTypeDefinitionTest.java
@@ -141,8 +141,8 @@ public class AclReadFieldTypeDefinitionTest {
   }
 
   private void setupFieldManager(BaseFieldManager fieldManager) throws IOException {
-    fieldManager.addColumnDefinition(FAM, "string", null, false, "string", false, null);
-    fieldManager.addColumnDefinition(FAM, "read", null, false, "acl-read", false, null);
+    fieldManager.addColumnDefinition(FAM, "string", null, false, "string", false, false, null);
+    fieldManager.addColumnDefinition(FAM, "read", null, false, "acl-read", false, false, null);
   }
 
   protected BaseFieldManager getFieldManager(Analyzer a) throws IOException {

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashDocValueTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashDocValueTest.java b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashDocValueTest.java
index ba93e56..694eafc 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashDocValueTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashDocValueTest.java
@@ -38,7 +38,7 @@ public class SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashDocValu
     props.put(BaseSpatialFieldTypeDefinition.SPATIAL_PREFIX_TREE, BaseSpatialFieldTypeDefinition.GEOHASH_PREFIX_TREE);
     props.put(SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.DOC_VALUE, "true");
     fieldManager.addColumnDefinition("fam", "geo", null, false,
-        SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.NAME, false, props);
+        SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.NAME, false, false, props);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashTest.java b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashTest.java
index ca52057..3525914 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashTest.java
@@ -24,7 +24,8 @@ import org.apache.blur.analysis.BaseFieldManager;
 import org.apache.lucene.queryparser.classic.ParseException;
 import org.junit.Test;
 
-public class SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashTest extends BaseSpatialFieldTypeDefinitionTest {
+public class SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashTest extends
+    BaseSpatialFieldTypeDefinitionTest {
 
   @Test
   public void testRecursivePrefixTreeWithGeohash() throws IOException, ParseException {
@@ -35,7 +36,7 @@ public class SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionGeohashTest ex
     Map<String, String> props = new HashMap<String, String>();
     props.put(BaseSpatialFieldTypeDefinition.SPATIAL_PREFIX_TREE, BaseSpatialFieldTypeDefinition.GEOHASH_PREFIX_TREE);
     fieldManager.addColumnDefinition("fam", "geo", null, false,
-        SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.NAME, false, props);
+        SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.NAME, false, false, props);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocValueTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocValueTest.java b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocValueTest.java
index ffaab4a..39b1351 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocValueTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocValueTest.java
@@ -38,7 +38,7 @@ public class SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocV
     props.put(BaseSpatialFieldTypeDefinition.SPATIAL_PREFIX_TREE, BaseSpatialFieldTypeDefinition.QUAD_PREFIX_TREE);
     props.put(SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.DOC_VALUE, "true");
     fieldManager.addColumnDefinition("fam", "geo", null, false,
-        SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.NAME, false, props);
+        SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.NAME, false, false, props);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest.java b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest.java
index 657a163..6f1470c 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest.java
@@ -36,7 +36,7 @@ public class SpatialRecursivePrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest
     Map<String, String> props = new HashMap<String, String>();
     props.put(BaseSpatialFieldTypeDefinition.SPATIAL_PREFIX_TREE, BaseSpatialFieldTypeDefinition.QUAD_PREFIX_TREE);
     fieldManager.addColumnDefinition("fam", "geo", null, false,
-        SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.NAME, false, props);
+        SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.NAME, false, false, props);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashDocValueTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashDocValueTest.java b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashDocValueTest.java
index 20602ea..e8ce21e 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashDocValueTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashDocValueTest.java
@@ -37,7 +37,7 @@ public class SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashDocValu
     props.put(BaseSpatialFieldTypeDefinition.SPATIAL_PREFIX_TREE, BaseSpatialFieldTypeDefinition.GEOHASH_PREFIX_TREE);
     props.put(SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.DOC_VALUE, "true");
     fieldManager.addColumnDefinition("fam", "geo", null, false,
-        SpatialTermQueryPrefixTreeStrategyFieldTypeDefinition.NAME, false, props);
+        SpatialTermQueryPrefixTreeStrategyFieldTypeDefinition.NAME, false, false, props);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashTest.java b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashTest.java
index 45c7b1e..8e6e66c 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashTest.java
@@ -66,7 +66,7 @@ public class SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionGeohashTest ex
     Map<String, String> props = new HashMap<String, String>();
     props.put(BaseSpatialFieldTypeDefinition.SPATIAL_PREFIX_TREE, BaseSpatialFieldTypeDefinition.GEOHASH_PREFIX_TREE);
     fieldManager.addColumnDefinition("fam", "geo", null, false,
-        SpatialTermQueryPrefixTreeStrategyFieldTypeDefinition.NAME, false, props);
+        SpatialTermQueryPrefixTreeStrategyFieldTypeDefinition.NAME, false, false, props);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocValueTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocValueTest.java b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocValueTest.java
index c6f6cb1..2399446 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocValueTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocValueTest.java
@@ -38,7 +38,7 @@ public class SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixDocV
     props.put(BaseSpatialFieldTypeDefinition.SPATIAL_PREFIX_TREE, BaseSpatialFieldTypeDefinition.QUAD_PREFIX_TREE);
     props.put(SpatialRecursivePrefixTreeStrategyFieldTypeDefinition.DOC_VALUE, "true");
     fieldManager.addColumnDefinition("fam", "geo", null, false,
-        SpatialTermQueryPrefixTreeStrategyFieldTypeDefinition.NAME, false, props);
+        SpatialTermQueryPrefixTreeStrategyFieldTypeDefinition.NAME, false, false, props);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest.java b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest.java
index 78eb470..c72f1f5 100644
--- a/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest.java
+++ b/blur-query/src/test/java/org/apache/blur/analysis/type/spatial/SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest.java
@@ -35,7 +35,7 @@ public class SpatialTermQueryPrefixTreeStrategyFieldTypeDefinitionQuadPrefixTest
     Map<String, String> props = new HashMap<String, String>();
     props.put(BaseSpatialFieldTypeDefinition.SPATIAL_PREFIX_TREE, BaseSpatialFieldTypeDefinition.QUAD_PREFIX_TREE);
     fieldManager.addColumnDefinition("fam", "geo", null, false,
-        SpatialTermQueryPrefixTreeStrategyFieldTypeDefinition.NAME, false, props);
+        SpatialTermQueryPrefixTreeStrategyFieldTypeDefinition.NAME, false, false, props);
   }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-query/src/test/java/org/apache/blur/lucene/search/SuperParserTest.java
----------------------------------------------------------------------
diff --git a/blur-query/src/test/java/org/apache/blur/lucene/search/SuperParserTest.java b/blur-query/src/test/java/org/apache/blur/lucene/search/SuperParserTest.java
index 09c44bd..970f84d 100644
--- a/blur-query/src/test/java/org/apache/blur/lucene/search/SuperParserTest.java
+++ b/blur-query/src/test/java/org/apache/blur/lucene/search/SuperParserTest.java
@@ -90,7 +90,7 @@ public class SuperParserTest {
       }
     };
 
-    fieldManager.addColumnDefinition(null, "bin", null, false, "string", true, null);
+    fieldManager.addColumnDefinition(null, "bin", null, false, "string", true, false, null);
     fieldManager.addColumnDefinitionInt("a", "id_i");
     fieldManager.addColumnDefinitionDouble("a", "id_d");
     fieldManager.addColumnDefinitionFloat("a", "id_f");

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/71b5c5e5/blur-shell/src/main/java/org/apache/blur/shell/AddColumnDefinitionCommand.java
----------------------------------------------------------------------
diff --git a/blur-shell/src/main/java/org/apache/blur/shell/AddColumnDefinitionCommand.java b/blur-shell/src/main/java/org/apache/blur/shell/AddColumnDefinitionCommand.java
index d67e377..2e06e7d 100644
--- a/blur-shell/src/main/java/org/apache/blur/shell/AddColumnDefinitionCommand.java
+++ b/blur-shell/src/main/java/org/apache/blur/shell/AddColumnDefinitionCommand.java
@@ -65,6 +65,12 @@ public class AddColumnDefinitionCommand extends Command implements TableFirstArg
         }
       }
     }
+    if (cmd.hasOption('M')) {
+      columnDefinition.setMultiValueField(true);
+    } else {
+      columnDefinition.setMultiValueField(false);
+    }
+
     if (!client.addColumnDefinition(args[1], columnDefinition)) {
       out.println("Column Definition was not added, check to see if the column has already been added to the table.");
     }
@@ -72,12 +78,12 @@ public class AddColumnDefinitionCommand extends Command implements TableFirstArg
 
   @Override
   public String description() {
-    return "Defines a new column in the named table. '-F' option is for fieldless searching and the '-S' is for sortability.";
+    return "Defines a new column in the named table. '-F' option is for fieldless searching, the '-S' is for sortability and '-M' is for allowing multiple values per column.";
   }
 
   @Override
   public String usage() {
-    return "<table name> <family> <column name> <type> [-s <sub column name>] [-F] [-S] [-p name value]*";
+    return "<table name> <family> <column name> <type> [-s <sub column name>] [-F] [-S] [-M] [-p name value]*";
   }
 
   @Override
@@ -96,6 +102,8 @@ public class AddColumnDefinitionCommand extends Command implements TableFirstArg
         .withDescription("Sets the properties for this column definition.").create("p"));
     options.addOption(OptionBuilder.withDescription(
         "Should the column definition be definied as a sortable column definition.").create("S"));
+    options.addOption(OptionBuilder.withDescription(
+        "Should the column definition be definied as a multi value column definition.").create("M"));
 
     CommandLineParser parser = new PosixParser();
     CommandLine cmd = null;


Mime
View raw message