Github user arjansh commented on a diff in the pull request:

    https://github.com/apache/metamodel/pull/182#discussion_r193786120
  
    --- Diff: 
hbase/src/main/java/org/apache/metamodel/hbase/HBaseCreateTableBuilder.java ---
    @@ -0,0 +1,98 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *   http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.metamodel.hbase;
    +
    +import java.util.Set;
    +
    +import org.apache.metamodel.MetaModelException;
    +import org.apache.metamodel.create.AbstractTableCreationBuilder;
    +import org.apache.metamodel.schema.MutableSchema;
    +import org.apache.metamodel.schema.Schema;
    +import org.apache.metamodel.schema.Table;
    +import org.apache.metamodel.util.SimpleTableDef;
    +
    +/**
    + * A builder-class to create tables in a HBase datastore
    + */
    +public class HBaseCreateTableBuilder extends 
AbstractTableCreationBuilder<HBaseUpdateCallback> {
    +
    +    private Set<String> _columnFamilies;
    +
    +    public HBaseCreateTableBuilder(final HBaseUpdateCallback 
updateCallback, final Schema schema, final String name) {
    +        this(updateCallback, schema, name, null);
    +    }
    +
    +    /**
    +     * Create a {@link HBaseCreateTableBuilder}.
    +     * Throws an {@link IllegalArgumentException} if the schema isn't a 
{@link MutableSchema}.
    +     * @param updateCallback
    +     * @param schema
    +     * @param name
    +     * @param columnFamilies
    +     */
    +    public HBaseCreateTableBuilder(final HBaseUpdateCallback 
updateCallback, final Schema schema, final String name,
    +            final Set<String> columnFamilies) {
    +        super(updateCallback, schema, name);
    +        if (!(schema instanceof MutableSchema)) {
    +            throw new IllegalArgumentException("Not a mutable schema: " + 
schema);
    +        }
    +        this._columnFamilies = columnFamilies;
    +    }
    +
    +    @Override
    +    public Table execute() {
    +        if (_columnFamilies == null || _columnFamilies.isEmpty()) {
    --- End diff --
    
    When you create an HBase table, you specify the Column Families for the 
tables. After the table has been created the Column Families are fixed and 
can't be changed. Within each column family you have the freedom to write what 
you want, so qualifiers aren't part of the creation of the table, the are 
created on the fly when writing data to an HBase table. Therefore we only 
mention column families and not qualifiers or a combination of both when 
creating the Table.


---

Reply via email to