package com.salesforce.phoenix.schema;

public enum ColumnSortOrder {
	
	ASC, DESC;
	
	
	public static ColumnSortOrder defaultValue() {
		return ASC;
	}	
	
	public static ColumnSortOrder fromDDLStatement(String sortOrder) {
		return sortOrder == null ? defaultValue() : ColumnSortOrder.valueOf(sortOrder.toUpperCase());
	}
	
	public static ColumnSortOrder fromDbValue(int value) {
		switch (value) {
		    case 0: return ASC;
		    case 1: return DESC;
		    default: throw new IllegalArgumentException("Bad db value for ColumnSortOrder: " + value);
		}
	}
	
	public int toDbValue() {
		return this == ASC ? 0 : 1;
	}
}

@@ -465,87 +465,28 @@
 lt: 
-throw new IllegalArgumentException(%22Bad db value for ColumnSortOrder: %22 + v
+return defaultV
 alue
+(
 );%0A%09

Return default value when sort order is not found in system.table.