// Path: connector-elasticsearch/src/main/java/com/stratio/connector/elasticsearch/core/engine/metadata/MetadataCreator.java
// public class MetadataCreator {
// 
//     /**
//      * This method creates the column metadata.
//      *
//      * @param queryData the queryData object.
//      * @return the list with the column metadata.
//      */
//     public List<ColumnMetadata> createColumnMetadata(ProjectParsed queryData) {
// 
//         List<ColumnMetadata> retunColumnMetadata = new ArrayList<>();
// 
//         Select select = queryData.getSelect();
// 
//         Map<Selector, String> columnAliasMap = select.getColumnMap();
//         for (Map.Entry<Selector, String> columnAliasName : columnAliasMap.entrySet()) {
//             ColumnMetadata columnMetadata = new ColumnMetadata(columnAliasName.getKey().getColumnName(), null,
//                     select.getTypeMapFromColumnName().get(columnAliasName.getKey()));
// 
//             columnMetadata.getName().setAlias(columnAliasName.getValue());
//             retunColumnMetadata.add(columnMetadata);
//         }
// 
//         return retunColumnMetadata;
//     }
// }


import com.stratio.connector.commons.engine.query.ProjectParsed;
import com.stratio.connector.commons.engine.query.ProjectValidator;
import com.stratio.connector.elasticsearch.core.engine.metadata.MetadataCreator;
import com.stratio.crossdata.common.data.ClusterName;
import com.stratio.crossdata.common.data.ColumnName;
import com.stratio.crossdata.common.data.TableName;
import com.stratio.crossdata.common.exceptions.ConnectorException;
import com.stratio.crossdata.common.logicalplan.Project;
import com.stratio.crossdata.common.logicalplan.Select;
import com.stratio.crossdata.common.metadata.ColumnMetadata;
import com.stratio.crossdata.common.metadata.ColumnType;
import com.stratio.crossdata.common.metadata.DataType;
import com.stratio.crossdata.common.metadata.Operations;
import com.stratio.crossdata.common.statements.structures.ColumnSelector;
import com.stratio.crossdata.common.statements.structures.Selector;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.*;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;
/*
 * Licensed to STRATIO (C) under one or more contributor license agreements.
 * See the NOTICE file distributed with this work for additional information
 * regarding copyright ownership.  The STRATIO (C) 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 com.stratio.connector.elasticsearch.core.engine.query.metadata;




/**
 * MetadataCreator Tester.
 *
 * @author <Authors name>
 * @version 1.0
 */

public class MetadataCreatorTest {

    private static final String CATALOG_NAME = "catalog_name";
    private static final String TABLE_NAME = "table_name";
    private static final String COLUMN_NAME1 = "column_name1";
    private static final String ALIAS_1 = "alias_1";

    private static final String COLUMN_NAME2 = "column_name2";
    private static final String ALIAS_2 = "alias_2";

    private static final String COLUMN_NAME3 = "column_name3";
    private String[] NAMES = { COLUMN_NAME1, COLUMN_NAME2, COLUMN_NAME3 };
    private static final String ALIAS_3 = "alias_3";
    private String[] ALIAS = { ALIAS_1, ALIAS_2, ALIAS_3 };
// Path: connector-elasticsearch/src/main/java/com/stratio/connector/elasticsearch/core/engine/metadata/MetadataCreator.java
// public class MetadataCreator {
// 
//     /**
//      * This method creates the column metadata.
//      *
//      * @param queryData the queryData object.
//      * @return the list with the column metadata.
//      */
//     public List<ColumnMetadata> createColumnMetadata(ProjectParsed queryData) {
// 
//         List<ColumnMetadata> retunColumnMetadata = new ArrayList<>();
// 
//         Select select = queryData.getSelect();
// 
//         Map<Selector, String> columnAliasMap = select.getColumnMap();
//         for (Map.Entry<Selector, String> columnAliasName : columnAliasMap.entrySet()) {
//             ColumnMetadata columnMetadata = new ColumnMetadata(columnAliasName.getKey().getColumnName(), null,
//                     select.getTypeMapFromColumnName().get(columnAliasName.getKey()));
// 
//             columnMetadata.getName().setAlias(columnAliasName.getValue());
//             retunColumnMetadata.add(columnMetadata);
//         }
// 
//         return retunColumnMetadata;
//     }
// }


// Path: connector-elasticsearch/src/test/java/com/stratio/connector/elasticsearch/core/engine/query/metadata/MetadataCreatorTest.java
import com.stratio.connector.commons.engine.query.ProjectParsed;
import com.stratio.connector.commons.engine.query.ProjectValidator;
import com.stratio.connector.elasticsearch.core.engine.metadata.MetadataCreator;
import com.stratio.crossdata.common.data.ClusterName;
import com.stratio.crossdata.common.data.ColumnName;
import com.stratio.crossdata.common.data.TableName;
import com.stratio.crossdata.common.exceptions.ConnectorException;
import com.stratio.crossdata.common.logicalplan.Project;
import com.stratio.crossdata.common.logicalplan.Select;
import com.stratio.crossdata.common.metadata.ColumnMetadata;
import com.stratio.crossdata.common.metadata.ColumnType;
import com.stratio.crossdata.common.metadata.DataType;
import com.stratio.crossdata.common.metadata.Operations;
import com.stratio.crossdata.common.statements.structures.ColumnSelector;
import com.stratio.crossdata.common.statements.structures.Selector;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.*;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.mock;

/*
 * Licensed to STRATIO (C) under one or more contributor license agreements.
 * See the NOTICE file distributed with this work for additional information
 * regarding copyright ownership.  The STRATIO (C) 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 com.stratio.connector.elasticsearch.core.engine.query.metadata;




/**
 * MetadataCreator Tester.
 *
 * @author <Authors name>
 * @version 1.0
 */

public class MetadataCreatorTest {

    private static final String CATALOG_NAME = "catalog_name";
    private static final String TABLE_NAME = "table_name";
    private static final String COLUMN_NAME1 = "column_name1";
    private static final String ALIAS_1 = "alias_1";

    private static final String COLUMN_NAME2 = "column_name2";
    private static final String ALIAS_2 = "alias_2";

    private static final String COLUMN_NAME3 = "column_name3";
    private String[] NAMES = { COLUMN_NAME1, COLUMN_NAME2, COLUMN_NAME3 };
    private static final String ALIAS_3 = "alias_3";
    private String[] ALIAS = { ALIAS_1, ALIAS_2, ALIAS_3 };
    MetadataCreator metadataCreator;