queryId)).queryDataSet
        records = convertQueryDataSet(rst, dataTypeList)
        if len(records) == 0:
            break
        for record in records:
            print(record)

    # do not forget to close it when a query is over
    closeReq = TSCloseOperationReq(sessionId)
    closeReq.queryId = queryId
    client.closeOperation(closeReq)

    # query metadata
    metaReq = TSFetchMetadataReq(sessionId=sessionId,
                                 type=MetaQueryTypes.CATALOG_DEVICES)
    print(client.fetchMetadata(metaReq).devices)

    metaReq = TSFetchMetadataReq(sessionId=sessionId,
                                 type=MetaQueryTypes.CATALOG_TIMESERIES,
                                 columnPath='root')
    print(client.fetchMetadata(metaReq).timeseriesList)

    metaReq = TSFetchMetadataReq(sessionId=sessionId,
                                 type=MetaQueryTypes.CATALOG_CHILD_PATHS,
                                 columnPath='root')
    print(client.fetchMetadata(metaReq).childPaths)

    metaReq = TSFetchMetadataReq(sessionId=sessionId,
                                 type=MetaQueryTypes.CATALOG_STORAGE_GROUP)
    print(client.fetchMetadata(metaReq).storageGroups)
                              True)).queryDataSet
        records = convertQueryDataSet(rst, dataTypeList)
        if len(records) == 0:
            break
        for record in records:
            print(record)

    # do not forget to close it when a query is over
    closeReq = TSCloseOperationReq(sessionId)
    closeReq.queryId = queryId
    client.closeOperation(closeReq)

    # query metadata
    metaReq = TSFetchMetadataReq(sessionId=sessionId,
                                 type=MetaQueryTypes.CATALOG_DEVICES)
    print(client.fetchMetadata(metaReq).status)

    metaReq = TSFetchMetadataReq(sessionId=sessionId,
                                 type=MetaQueryTypes.CATALOG_TIMESERIES,
                                 columnPath='root')
    #print(client.fetchMetadata(metaReq).timeseriesList)

    metaReq = TSFetchMetadataReq(sessionId=sessionId,
                                 type=MetaQueryTypes.CATALOG_CHILD_PATHS,
                                 columnPath='root')
    #print(client.fetchMetadata(metaReq).childPaths)

    metaReq = TSFetchMetadataReq(sessionId=sessionId,
                                 type=MetaQueryTypes.CATALOG_STORAGE_GROUP)
    #print(client.fetchMetadata(metaReq).storageGroups)