metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kaspersorensen <>
Subject [GitHub] metamodel pull request: Fresh PR for Sor
Date Sun, 26 Apr 2015 18:49:35 GMT
Github user kaspersorensen commented on a diff in the pull request:
    --- Diff: solr/src/main/java/org/apache/metamodel/solr/ ---
    @@ -0,0 +1,403 @@
    + * 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
    + *
    + *
    + *
    + * Unless required by applicable law or agreed to in writing,
    + * software distributed under the License is distributed on an
    + * KIND, either express or implied.  See the License for the
    + * specific language governing permissions and limitations
    + * under the License.
    + */
    +package org.apache.metamodel.solr;
    +import java.lang.reflect.Method;
    +import java.util.ArrayList;
    +import java.util.Arrays;
    +import java.util.Comparator;
    +import java.util.HashMap;
    +import java.util.Iterator;
    +import java.util.List;
    +import java.util.Map;
    +import org.apache.http.HttpResponse;
    +import org.apache.http.client.HttpClient;
    +import org.apache.http.client.methods.HttpGet;
    +import org.apache.http.impl.client.DefaultHttpClient;
    +import org.apache.metamodel.DataContext;
    +import org.apache.metamodel.MetaModelException;
    +import org.apache.metamodel.query.Query;
    +import org.apache.metamodel.QueryPostprocessDataContext;
    +import org.apache.metamodel.query.FilterClause;
    +import org.apache.metamodel.query.FilterItem;
    +import org.apache.metamodel.query.GroupByItem;
    +import org.apache.metamodel.query.OrderByItem;
    +import org.apache.metamodel.query.SelectItem;
    +import org.apache.metamodel.query.LogicalOperator;
    +import org.apache.metamodel.query.OperatorType;
    +import org.apache.metamodel.query.FunctionType;
    +import org.apache.metamodel.schema.Column;
    +import org.apache.metamodel.schema.ColumnType;
    +import org.apache.metamodel.schema.MutableColumn;
    +import org.apache.metamodel.schema.MutableSchema;
    +import org.apache.metamodel.schema.MutableTable;
    +import org.apache.metamodel.schema.Schema;
    +import org.apache.metamodel.schema.Table;
    +import org.apache.metamodel.util.SimpleTableDef;
    +import org.apache.solr.client.solrj.SolrQuery;
    +import org.apache.solr.client.solrj.SolrQuery.ORDER;
    +import org.apache.solr.client.solrj.SolrServerException;
    +import org.apache.solr.client.solrj.impl.HttpSolrServer;
    +import org.apache.solr.client.solrj.response.QueryResponse;
    +import org.apache.solr.client.solrj.response.FacetField;
    +import org.apache.solr.common.SolrDocumentList;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +import com.fasterxml.jackson.databind.ObjectMapper;
    +import com.fasterxml.jackson.databind.ObjectReader;
    + * DataContext implementation for ElasticSearch analytics engine.
    + * 
    + * ElasticSearch has a data storage structure hierarchy that briefly goes like
    + * this:
    + * <ul>
    + * <li>Index</li>
    + * <li>Document type (short: Type) (within an index)</li>
    + * <li>Documents (of a particular type)</li>
    + * </ul>
    + * 
    + * When instantiating this DataContext, an index name is provided. Within this
    + * index, each document type is represented as a table.
    + * 
    + * This implementation supports either automatic discovery of a schema or manual
    + * specification of a schema, through the {@link SimpleTableDef} class.
    + */
    +public class SolrDataContext extends QueryPostprocessDataContext implements
    +        DataContext {
    +    private static final Logger logger = LoggerFactory
    +            .getLogger(SolrDataContext.class);
    +    public static final String FIELD_ID = "id";
    --- End diff --
    I don't understand why we have a special logic for adding an ID field when there is no
special logic for querying it. I think it might very well even be a source of bugs in the
current code because if you add a column called "id" to every table and then don't do anything
to ensure that there are values in the rows you return for this "id" column, then the rows'
data and metadata will be inconsistent.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message