[ https://issues.apache.org/jira/browse/SOLR-9691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15605874#comment-15605874 ]
Timothy Potter edited comment on SOLR-9691 at 10/25/16 5:08 PM: ---------------------------------------------------------------- yes, the Tuple has {{count(*)}} as a key in the map ... {code} update: columnName="count(*)", tuple: org.apache.solr.client.solrj.io.Tuple@4f5219db, {product_id=1234, count(*)=4, model_num=X} {code} so adding the double quotes around the {{count(*)}} arg passed to {{sum()}} doesn't work because the double-quotes sounds more like this is a bug vs. an improvement ... was (Author: thelabdude): yes, the Tuple has count(*) as a key in the map ... update: columnName="count(*)", tuple: org.apache.solr.client.solrj.io.Tuple@4f5219db, {product_id=1234, count(*)=4, model_num=X} so adding the double quotes around the count(*) arg passed to sum() doesn't work because the double-quotes sounds more like this is a bug vs. an improvement ... > Streaming expressions need to be able to use a metric computed by the facet > stream as a field in other streams. > --------------------------------------------------------------------------------------------------------------- > > Key: SOLR-9691 > URL: https://issues.apache.org/jira/browse/SOLR-9691 > Project: Solr > Issue Type: Improvement > Security Level: Public(Default Security Level. Issues are Public) > Components: Parallel SQL > Affects Versions: 6.2.1 > Reporter: Timothy Potter > > Using 6.2.1, I want to use a facet stream to do an intermediate count and > then sum up the counts in a rollup stream, i.e. something like: > {code} > rollup( > sort( > hashJoin( > search(products, > q="*:*", > fl="product_id,model_num", > sort="product_id asc", > qt="/export", > partitionKeys="product_id"), > hashed=facet(transactions, q="*:*", buckets="product_id", > bucketSizeLimit=1000000, bucketSorts="product_id asc", count(*)), > on="product_id" > ), > by="model_num asc" > ), > over="model_num", > sum(count(*)) > ) > {code} > Basically, I want to get a count of each product_id from the transactions > collection (# of transactions per product) and then join that with the > products table to generate a projection containing: > {code} > { > "result-set": { > "docs": [ > { > "product_id": "1234", > "count(*)": 4, > "model_num": "X" > }, > { > "product_id": "5678", > "count(*)": 5, > "model_num": "Y" > }, > ... > ] > } > } > {code} > This works, but the outer rollup doesn't recognize the count(*) as a field. I > get this error: > {code} > { > "result-set": { > "docs": [ > { > "EXCEPTION": "Invalid expression sum(count(*)) - expected > sum(columnName)", > "EOF": true > } > ] > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org