Skip to content

PRINT

1. PRINT Statement

The "PRINT" statement allows users to to output images, audio, and video files.

2. PRINT Syntax

The "PRINT" syntax.

query_statement:
    query_expr

PRINT { IMAGE | AUDIO | VIDEO }
AS
(query_expr)

The "PRINT" syntax with an "OPTIONS" clause.

query_statement:
    query_expr

PRINT { IMAGE | AUDIO | VIDEO }
OPTIONS (
    image_col | audio_col | video_col = (column_name)
    )
AS
(query_expr)

Query Details

  • The "OPTIONS" clause allows you to change the value of a parameter. The definition of each parameter is as follows:
    • "image_col | audio_col | video_col": the name of a column to be printed (str, default: 'image_path'|'audio_path'|'video_path')

3. PRINT Example

3-1. Image Print

Outputs image files from the table.

%%thanosql
PRINT IMAGE
OPTIONS (
    image_col='image'
    )
AS
SELECT *
FROM image_table
  • "image_table": table containing paths of the image files

3-2. Audio Print

Outputs audio files from the table.

%%thanosql
PRINT AUDIO
OPTIONS (
    audio_col='audio'
    )
AS
SELECT *
FROM audio_table

IMAGE

  • "audio_table": table containing paths of the audio files

3-3. Video Print

Outputs video files from the table.

%%thanosql
PRINT VIDEO
OPTIONS (
    video_col='video'
    )
AS
SELECT *
FROM video_table
  • "video_table": table containing paths of the video files

3-4. Print with a Subquery

The following statement outputs the results of "SEARCH" statement created in the nested SEARCH.

%%thanosql
PRINT IMAGE
AS (
    SELECT image_path, search_result
    FROM (
        SEARCH IMAGE
        USING my_image_search_model
        OPTIONS (
            search_by='image',
            search_input='thanosql-dataset/mnist_data/test/923.jpg',
            emb_col='convert_result',
            result_col='search_result',
            top_k=4
            )
        AS
        SELECT *
        FROM mnist_test
        )
    )

Last update: 2023-08-09