

from BaseDataMaintenance.common.Utils import getRow_ots
from BaseDataMaintenance.dataSource.source import getConnect_ots_capacity,getConnect_ots

from tablestore import *


ots_client = getConnect_ots()


query = BoolQuery(must_queries=[TermQuery("page_time","2022-12-02")],
                  should_queries=[TermQuery("province","广西"),
                                  TermQuery("province","广东")])
rows,next_token,total_count,is_all_succeed = ots_client.search("project2","project2_index",
                                                               SearchQuery(query,get_total_count=True,limit=100),
                                                               columns_to_get=ColumnsToGet(column_names=["page_time","province"],return_type=ColumnReturnType.SPECIFIED))
print(total_count)
print(getRow_ots(rows))
