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

com.alibaba.druid.support.opds.udf.MetaSqlExtract Maven / Gradle / Ivy

There is a newer version: 1.2.23
Show newest version
package com.alibaba.druid.support.opds.udf;

import com.aliyun.odps.udf.UDF;
import org.apache.commons.lang.StringEscapeUtils;

public class MetaSqlExtract extends UDF {
    public String evaluate(String xml) {
        if (xml == null || xml.length() == 0) {
            return null;
        }

        int p0 = xml.indexOf("");
        if (p0 == -1) {
            return null;
        }
        p0 += "".length();

        int p1 = xml.indexOf("", p0);
        if (p1 == -1) {
            return null;
        }

        String sql = xml.substring(p0, p1);
        int p2 = xml.indexOf(" "




© 2015 - 2024 Weber Informatics LLC | Privacy Policy