Documentation Invantiveune partie de Invantive cloud
Forums d'Invantive SupportConnectez-vous/inscrivez-vous

ZSTD_COMPRESS

Syntaxe

%%{init: {
  'theme': 'base',
  'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' },
  'themeVariables': {
    'fontSize': '11px',
    'fontFamily': 'Arial'
  }
}}%%
flowchart LR
    Start((START)) --> ZSTD_COMPRESS[ZSTD_COMPRESS]:::quoted
    ZSTD_COMPRESS --> End((END))

Objet

La fonction SQL ZSTD_COMPRESS compresse une image blob à l'aide de l'algorithme Zstandard.

Voir également ZSTD_DECOMPRESS et ZLIB_COMPRESS.

Paramètres :

  • Entrée (blob) : l'image blob à compresser.

Renvoie : une version compressée au format Zstandard de la donnée d'entrée.

Exemples

L'exemple suivant compresse et décompresse les neuf caractères ASCII ACME, puis récupère le texte d'origine :

select blob_to_text(zstd_decompress(zstd_compress(ascii_to_blob('ACME'))))

-------------------
ACME

L'exemple suivant compresse un texte et récupère l'blob compressé, encodé en base64 :

select base64_encode(zstd_compress('VGhpcyBpcyBhIHZlcnkgbG9uZyB0ZXh0IHRvIHRlc3QgdGhlIFpzdGQgY29tcHJlc3Npb24gbWV0aG9k'))

-------------------
KLUv/SA8vQEAwsMMFLAnHd2OTKNtYpi2ISYmwTDAZCECxao8IzN3TMax4dILZvUeu/Ui7ASy4iTxWPjMZwoIAA==