diff --git a/docs/user/dql/metadata.rst b/docs/user/dql/metadata.rst index fa233020a3..aba4eb0c75 100644 --- a/docs/user/dql/metadata.rst +++ b/docs/user/dql/metadata.rst @@ -35,7 +35,7 @@ Example 1: Show All Indices Information SQL query:: os> SHOW TABLES LIKE '%' - fetched rows / total rows = 9/9 + fetched rows / total rows = 10/10 +----------------+-------------+-----------------+------------+---------+----------+------------+-----------+---------------------------+----------------+ | TABLE_CAT | TABLE_SCHEM | TABLE_NAME | TABLE_TYPE | REMARKS | TYPE_CAT | TYPE_SCHEM | TYPE_NAME | SELF_REFERENCING_COL_NAME | REF_GENERATION | |----------------+-------------+-----------------+------------+---------+----------+------------+-----------+---------------------------+----------------| @@ -47,6 +47,7 @@ SQL query:: | docTestCluster | null | nested | BASE TABLE | null | null | null | null | null | null | | docTestCluster | null | nyc_taxi | BASE TABLE | null | null | null | null | null | null | | docTestCluster | null | people | BASE TABLE | null | null | null | null | null | null | + | docTestCluster | null | weblogs | BASE TABLE | null | null | null | null | null | null | | docTestCluster | null | wildcard | BASE TABLE | null | null | null | null | null | null | +----------------+-------------+-----------------+------------+---------+----------+------------+-----------+---------------------------+----------------+ diff --git a/docs/user/ppl/functions/ip.rst b/docs/user/ppl/functions/ip.rst index f6c5d3e787..ff6d929d45 100644 --- a/docs/user/ppl/functions/ip.rst +++ b/docs/user/ppl/functions/ip.rst @@ -22,11 +22,10 @@ Return type: BOOLEAN Example:: - os> source=weblogs | where cidrmatch(host, "199.120.110.0/24") | fields host - fetched rows / total rows = 1/3 + os> source=weblogs | where cidrmatch(host, "199.120.110.0/24") | fields host ; + fetched rows / total rows = 1/1 +----------------+ | host | - |----------------+ + |----------------| | 199.120.110.21 | +----------------+ - diff --git a/doctest/test_docs.py b/doctest/test_docs.py index 881078a9bd..30306dce2e 100644 --- a/doctest/test_docs.py +++ b/doctest/test_docs.py @@ -1,21 +1,20 @@ # Copyright OpenSearch Contributors # SPDX-License-Identifier: Apache-2.0 +import click import doctest +import json import os import os.path -import zc.customdoctests -import json -import re import random +import re import subprocess import unittest -import click - +import zc.customdoctests from functools import partial +from opensearch_sql_cli.formatter import Formatter from opensearch_sql_cli.opensearch_connection import OpenSearchConnection from opensearch_sql_cli.utils import OutputSettings -from opensearch_sql_cli.formatter import Formatter from opensearchpy import OpenSearch, helpers ENDPOINT = "http://localhost:9200" @@ -29,7 +28,7 @@ WILDCARD = "wildcard" NESTED = "nested" DATASOURCES = ".ql-datasources" - +WEBLOGS = "weblogs" class DocTestConnection(OpenSearchConnection): @@ -122,6 +121,7 @@ def set_up_test_indices(test): load_file("wildcard.json", index_name=WILDCARD) load_file("nested_objects.json", index_name=NESTED) load_file("datasources.json", index_name=DATASOURCES) + load_file("weblogs.json", index_name=WEBLOGS) def load_file(filename, index_name): @@ -150,7 +150,7 @@ def set_up(test): def tear_down(test): # drop leftover tables after each test - test_data_client.indices.delete(index=[ACCOUNTS, EMPLOYEES, PEOPLE, ACCOUNT2, NYC_TAXI, BOOKS, APACHE, WILDCARD, NESTED], ignore_unavailable=True) + test_data_client.indices.delete(index=[ACCOUNTS, EMPLOYEES, PEOPLE, ACCOUNT2, NYC_TAXI, BOOKS, APACHE, WILDCARD, NESTED, WEBLOGS], ignore_unavailable=True) docsuite = partial(doctest.DocFileSuite,