RE: Using hiveSQL to find content

avatar

You are viewing a single comment's thread:

This is used to filter out tags/topics. I don't know these languages and so wish to exclude them from the results. $.tags is a section of C.json_metadata and so wildcard searching, although painful, is less of an issue. There is likely a better way to do this, and I hope someone can chip in.

The way I do it is expand the json out and use it as a join and cross apply, kind of a pain in the ass but works good. Every query that uses this is a brain teaser.



0
0
0.000
4 comments
avatar

Yeah that sounds nasty, but probably better/quicker. Got an example? :D

0
0
0.000
avatar
SELECT Json_value(voters.voters, '$.voter')   AS voter,
               Json_value(voters.voters, '$.time')    AS time,
               Json_value(voters.voters, '$.rshares') AS rshares
        FROM   (SELECT votes.[value] AS voters,
                       c.author,
                       c.permlink
                FROM   comments c
                       CROSS apply Openjson(c.active_votes) AS votes
                WHERE  c.author = 'themarkymark'
                       AND c.permlink =
                           '315-pairs-of-socks-have-a-marketcap-of-usd28-million-dollars') AS voters
0
0
0.000
avatar

I like it, cheers!

0
0
0.000
avatar

Congrats, you were upvoted from this account because you were in Top 25 engagers yesterday on STEMGeeks .
You made a total of 3 comments and talked to 3 different authors .
Your rank is 5 .
For more details about this project please read here - link to announcement post
You can also delegate and get weekly payouts.

0
0
0.000