Write the schema for a nestedAlias to System.out. Denoted by alias::nestedAlias. @param alias Alias whose schema has nestedAlias @param nestedAlias Alias whose schema will be written out @return Schema of alias dumped @throws IOException
(String alias, String nestedAlias)
| 921 | * @throws IOException |
| 922 | */ |
| 923 | public Schema dumpSchemaNested(String alias, String nestedAlias) throws IOException { |
| 924 | try { |
| 925 | pigContext.inDumpSchema = true; |
| 926 | if ("@".equals(alias)) { |
| 927 | alias = getLastRel(); |
| 928 | } |
| 929 | Operator op = getOperatorForAlias( alias ); |
| 930 | if( op instanceof LOForEach ) { |
| 931 | LogicalSchema nestedSc = ((LOForEach)op).dumpNestedSchema(alias, nestedAlias); |
| 932 | if (nestedSc!=null) { |
| 933 | Schema s = org.apache.pig.newplan.logical.Util.translateSchema(nestedSc); |
| 934 | System.out.println(alias+ "::" + nestedAlias + ": " + s.toString()); |
| 935 | return s; |
| 936 | } |
| 937 | else { |
| 938 | System.out.println("Schema for "+ alias+ "::" + nestedAlias + " unknown."); |
| 939 | return null; |
| 940 | } |
| 941 | } |
| 942 | else { |
| 943 | int errCode = 1001; |
| 944 | String msg = "Unable to describe schema for " + alias + "::" + nestedAlias; |
| 945 | throw new FrontendException (msg, errCode, PigException.INPUT, false, null); |
| 946 | } |
| 947 | } finally { |
| 948 | pigContext.inDumpSchema = false; |
| 949 | } |
| 950 | } |
| 951 | |
| 952 | /** |
| 953 | * Set the name of the job. This name will get translated to mapred.job.name. |