Java Code Examples for org.apache.phoenix.query.QueryConstants#DEFAULT_COLUMN_FAMILY_BYTES

The following examples show how to use org.apache.phoenix.query.QueryConstants#DEFAULT_COLUMN_FAMILY_BYTES . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocalIndexDataColumnRef.java    From phoenix with Apache License 2.0 5 votes vote down vote up
@Override
public ColumnExpression newColumnExpression(boolean schemaNameCaseSensitive, boolean colNameCaseSensitive) {
    PTable table = this.getTable();
    PColumn column = this.getColumn();
    // TODO: util for this or store in member variable
    byte[] defaultFamily = table.getDefaultFamilyName() == null ? QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES : table.getDefaultFamilyName().getBytes();
    String displayName = SchemaUtil.getColumnDisplayName(Bytes.compareTo(defaultFamily, column.getFamilyName().getBytes()) == 0  ? null : column.getFamilyName().getBytes(), column.getName().getBytes());
    return new ProjectedColumnExpression(this.getColumn(), columns, position, displayName);
}
 
Example 2
Source File: SchemaUtil.java    From phoenix with Apache License 2.0 4 votes vote down vote up
public static byte[] getEmptyColumnFamily(PName defaultColumnFamily, List<PColumnFamily> families) {
    return families.isEmpty() ? defaultColumnFamily == null ? QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES : defaultColumnFamily.getBytes() : families.get(0).getName().getBytes();
}
 
Example 3
Source File: SchemaUtil.java    From phoenix with Apache License 2.0 4 votes vote down vote up
public static byte[] getEmptyColumnFamily(PTable table) {
    List<PColumnFamily> families = table.getColumnFamilies();
    return families.isEmpty() ? table.getDefaultFamilyName() == null ? QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES : table.getDefaultFamilyName().getBytes() : families.get(0).getName().getBytes();
}
 
Example 4
Source File: TestUtil.java    From phoenix with Apache License 2.0 4 votes vote down vote up
public static RowKeyComparisonFilter rowKeyFilter(Expression e) {
    return  new RowKeyComparisonFilter(e, QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES);
}
 
Example 5
Source File: SchemaUtil.java    From phoenix with Apache License 2.0 4 votes vote down vote up
public static byte[] getEmptyColumnFamily(PName defaultColumnFamily, List<PColumnFamily> families, boolean isLocalIndex) {
    return families.isEmpty() ? defaultColumnFamily == null ? (isLocalIndex ? QueryConstants.DEFAULT_LOCAL_INDEX_COLUMN_FAMILY_BYTES : QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES) : defaultColumnFamily.getBytes() : families.get(0).getName().getBytes();
}
 
Example 6
Source File: SchemaUtil.java    From phoenix with Apache License 2.0 4 votes vote down vote up
public static byte[] getEmptyColumnFamily(PTable table) {
    List<PColumnFamily> families = table.getColumnFamilies();
    return families.isEmpty() ? table.getDefaultFamilyName() == null ? (table.getIndexType() == IndexType.LOCAL ? QueryConstants.DEFAULT_LOCAL_INDEX_COLUMN_FAMILY_BYTES : QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES) : table.getDefaultFamilyName().getBytes() : families.get(0).getName().getBytes();
}
 
Example 7
Source File: TestUtil.java    From phoenix with Apache License 2.0 4 votes vote down vote up
public static RowKeyComparisonFilter rowKeyFilter(Expression e) {
    return  new RowKeyComparisonFilter(e, QueryConstants.DEFAULT_COLUMN_FAMILY_BYTES);
}