import asyncio
import json
import sys
sys.stdout.reconfigure(encoding='utf-8')

from common.starrocks_connection import get_db_connection

async def main():
    db = get_db_connection()
    rows = await db.execute_query_async(
        "SELECT size_scale, LEFT(description_text, 100) as desc_short "
        "FROM shared_source.magento_product_dimension_with_text_embedding "
        "WHERE description_text IS NOT NULL AND description_text != '' "
        "LIMIT 5"
    )
    for r in rows:
        print(json.dumps(r, ensure_ascii=False))

asyncio.run(main())
