HiveSQL - Querying Json_metadata with App = "Ecency" - Figuring Out Active Users Number by Post & Comment Numbers....

Hey All,

First a disclaimer here - I am learning to mine data via the HiveSQL so there could be chances that my queries may be wrong or not very optimized like an experience developer. I am giving it a try to mine data and extract some useful information from it. This time I have tried to extract data that is tied to the - "Ecency App Usage". One of my friend here on the HIVE chain @untilwelearn requested me if I could get him active users of the "Ecency App". First I was wondering how could I get him this information and I said will try to see what I can get but no promises. So this post is to answer his question and at the same time exploring my journey with HiveSQL. Please don't consider the results of the query as final there could be more better ways of extracting the data which I am may be not aware of due to my little knowledge here as I am still exploring. But the logic that I have used to get here is the best based on my understand and the tables information available on HiveSQL. This time around I have explored mainly the table - "TxComments" - Blockchain operations - comment

Here is the Table - TxComments Information.

image.png

source:

Query for extracting records tied to Posts (Original Content)

Here is the query that I triggered to get me authors, using the ecency App to post. From the "json_metadata" column I am looking for "app:ecency" to different if from other apps that may be used for posting like - peadk, inleo, hive.blog, waivio and other platforms.


SELECT  
    author,  
    'post' AS action_type,  
    CONCAT('https://ecency.com/@', author, '/', permlink) AS post_link  
FROM TxComments WITH (NOLOCK)   -- preventing blocking
WHERE parent_author = ''  -- Selecting only post not comments
AND json_metadata LIKE '%"app":"ecency/%'  
AND CAST(timestamp AS DATE) = '2025-03-14'  
GROUP BY author, permlink  
ORDER BY author;  

Output of the Query

#AuthorAction TypePost Link
1abeerhunterpostNelly Maui - Badlands Brewing
2abelartepostDescubriendo el verdadero concepto de
3aburihan1postA Beautiful Display of Fresh
4adaezeinchristpostThe Beginning of a New
5adrianh1postSky C38c4cbf3afe2
6adrirxdpostLa Depresion y Autolesiones
7aetaitaepostDon't Tnod
8aiunapostThree Winners - Holozing Contest
9akdxpostHappy Holi to Everyone
10alberto0607postVprbcqpedf
...... Getting Top 10 and Last 10 rows data.........
531yundie8710postHistory Collector
532yundie8710postWelcome to Villa
533zakludickpostTeamwork: Hive Community
534zakludickpostWarhammer 40K Review
535zhulapostGenus Anoplocnemis
536zuliquijada22postBreakfast Outside
537zuliquijada22postLadies of Hive Contest

A total of 537 posts were made using the Ecency App and now we need to check on the comments as well since there would be folks who are interacting with the App for commenting too. Lets see with what query I came up with.

Query for extracting records that is tied to Comments


WITH UniqueUserComments AS (
    SELECT  
        author,  
        'comment' AS action_type,  
        CONCAT('https://ecency.com/@', parent_author, '/', parent_permlink, '#', author) AS comment_link,  
        ROW_NUMBER() OVER (PARTITION BY author ORDER BY timestamp) AS rn  -- # symbol for pointing to a specific comment in the post 
    FROM TxComments WITH (NOLOCK)  
    WHERE parent_author <> ''  --  getting only comments
    AND json_metadata LIKE '%"app":"ecency/%'  
    AND CAST(timestamp AS DATE) = '2025-03-14'  
)  
SELECT author, action_type, comment_link  
FROM UniqueUserComments  
WHERE rn = 1  
ORDER BY author;  

Output of the Query...

S.NoAuthorAction TypeComment Link
1a07commentLink
2abdul-quduscommentLink
3abelartecommentLink
4abelfotografiacommentLink
5abenadcommentLink
6abu78commentLink
7aburihan1commentLink
8acgalarzacommentLink
9ach67commentLink
10adaezeinchristcommentLink
S.NoAuthorAction TypeComment Link
701yuslenismolinacommentLink
702yzamazingcommentLink
703zain-ab001commentLink
704zakludickcommentLink
705zhangyan-123commentLink
706zo3dcommentLink
707zubygeeecommentLink
708zuliquijada22commentLink

I am considering only one comment from the user only here. Since we are more interested in getting active users so there is no point counting comments made by a user multiple times. Ideally post should also have the same structure but for now I have made no selection criteria there since its a limited number no one is going to write two or three posts in a day. Now that we have total comment numbers lets add then up to get total active users on Ecency App for 14th March, 2025

Active users on Ecency on 14 March 2025 = Users who posted [537] + Users who commented [708] = 1245

Yes, I am aware that there could be further elimination that can do done by removing folks from the comments who have already appeared as Author. So not making it further complex and based on the above two queries results on post and comments I can say that the active users using ecency App of 14th March, 2025 was around 1245 give and take +- 50. So at least we get some idea here on the active user level engagement using the Ecency App. Let me know your views and if you have any other approach in getting to this numbers. In my next post I will perfrom a similar execrise and see what I get for other portals [peakd, inleo, hive.io and others].. @untilwelearn bhai check out the numbers which you were requesting..hope this helps to an extent... Happy Learning... cheers

HiveSQL - Querying Json_metadata with App = "Ecency" - Figuring Out Active Users Number by Post & Comment Numbers....

#hivesql #DBeaver #learning #hivestatistics #data #datamining #hiveaccount #liquidhive #DynamicGlobalProperties #ecency #TxComments

Refer my previous posts around querying HiveSql::



image source:: hive.io, hive x, canva

Best Regards
Paras

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
9 Comments