public Var cast(String val) {
    if (!constant && type == Type.STRING) {
      if (len != 0 ) {
        int l = val.length();
        if (l > len) {
          value = val.substring(0, len);
          return this;
        }
      }
      value = val;
    }
    return this;
  }
Cast a new string value to the variable
hplsql/src/main/java/org/apache/hive/hplsql/Var.java