All Downloads are FREE. Search and download functionalities are using the official Maven repository.

static.js.main.js Maven / Gradle / Ivy

Go to download

A library for analyzing, processing, and rewriting views defined in the Hive Metastore, and sharing them across multiple execution engines

There is a newer version: 2.2.51
Show newest version
$(document).ready(function () {
    $("#btn-create").click(function (e) {
        e.preventDefault();
        run_creation_sql();
    });

    $("#btn-translate").click(function (e) {
        e.preventDefault();
        run_translation_sql();
    });

    $("#btn-clear-create").click(function (e) {
        e.preventDefault();
        $("#statement").val("");
        $("#creation-result").html("");
    });

    $("#btn-clear-translate").click(function (e) {
        e.preventDefault();
        $("#query").val("");
        $("#translation-result").html("");
    })
});

function run_creation_sql() {
    var statement = $("#statement").val().trim();
    console.log(statement);
    if (statement === "") {
        const feedback = ``;
        $('#creation-result').html(feedback);
        return;
    }
    $.ajax({
        type: "POST",
        contentType: "application/json",
        url: "/api/catalog-ops/execute",
        data: statement,
        dataType: 'json',
        cache: false,
        timeout: 600000,
        complete: function (e) {
            const feedback = ``;
            $('#creation-result').html(feedback);
        }
    });
}

function run_translation_sql() {
    var translateRequestBody = {};
    translateRequestBody["fromLanguage"] = $("#from-language").val();
    translateRequestBody["toLanguage"] = $("#to-language").val();
    translateRequestBody["query"] = $("#query").val();
    $.ajax({
        type: "POST",
        contentType: "application/json",
        url: "/api/translations/translate",
        data: JSON.stringify(translateRequestBody),
        dataType: 'json',
        cache: false,
        timeout: 600000,
        complete: function (e) {
            const feedback = `
`; $('#translation-result').html(feedback); } }); } function get_message(responseText) { try { const json = JSON.parse(responseText); return "message" in json ? json.message : responseText; } catch (e) { return responseText; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy