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

    https://github.com/apache/lucene-solr/pull/104#discussion_r85477095
  
    --- Diff: solr/core/src/java/org/apache/solr/handler/SQLHandler.java ---
    @@ -126,30 +101,46 @@ public void handleRequestBody(SolrQueryRequest req, 
SolrQueryResponse rsp) throw
             throw new Exception("stmt parameter cannot be null");
           }
     
    -      context.setSolrClientCache(StreamHandler.clientCache);
    +      String url = "jdbc:calcitesolr:";
    +
    +      Properties properties = new Properties();
    +      // Add all query parameters
    +      Iterator<String> parameterNamesIterator = 
params.getParameterNamesIterator();
    +      while(parameterNamesIterator.hasNext()) {
    +        String param = parameterNamesIterator.next();
    +        properties.setProperty(param, params.get(param));
    +      }
    +
    +      // Set these last to ensure that they are set properly
    +      properties.setProperty("lex", Lex.MYSQL.toString());
    +      properties.setProperty("zk", defaultZkhost);
    +
    +      String driverClass = CalciteSolrDriver.class.getCanonicalName();
    +
    +      // JDBC driver requires metadata from the SQLHandler. Default to 
false since this adds a new Metadata stream.
    +      if(params.getBool("includeMetadata", false)) {
    +        /*
    +         * Would be great to replace this with the JDBCStream. Can't do 
that currently since need to have metadata
    +         * added to the stream for the JDBC driver. This could be fixed by 
using the Calcite Avatica server and client.
    +         */
    +        tupleStream = new SqlHandlerStream(url, sql, properties, 
driverClass);
    --- End diff --
    
    Would be awesome to use JDBCStream in SqlHandlerStream...


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to