Merging changes
This commit is contained in:
1 parent
c4216d2272
commit
797816be7e
437 files changed
+54228
-28
No files matched your search
@@ -0,0 +1,115 @@
|
||||
// using System;
|
||||
// using System.Collections;
|
||||
// using BCG.Evaluator.ColumnMapExpression;
|
||||
|
||||
// namespace BCG
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// Provides the place holder for the int array that maps aliased column indices to the original
|
||||
// /// ones (and the algorithms to compute them)
|
||||
// /// </summary>
|
||||
// internal class ProjectHelper
|
||||
// {
|
||||
// internal int[] colMap;
|
||||
// internal IBlueTableSchema schema;
|
||||
// internal string[] relevantOrigCols;
|
||||
|
||||
// /// <summary>
|
||||
// /// </summary>
|
||||
// /// <param name="isch">original(unprojected) schema</param>
|
||||
// /// <param name="exp">expression defining the mapping</param>
|
||||
// /// <param name="tableName">table name of the new schema</param>
|
||||
// internal ProjectHelper (IBlueTableSchema isch, string exp, string tableName)
|
||||
// : this (isch, myGetDictionary (isch, exp), tableName)
|
||||
// {}
|
||||
|
||||
// /// <summary>
|
||||
// /// </summary>
|
||||
// /// <param name="isch">original (unprojected) schema</param>
|
||||
// /// <param name="origToAlias">dictionary mapping unprojected names to their projected names, dropped cols should not be there</param>
|
||||
// /// <param name="tableName">table name of the new schema</param>
|
||||
// internal ProjectHelper (IBlueTableSchema isch, IDictionary origToAlias, string tableName)
|
||||
// {
|
||||
// ArrayList colMapAl = new ArrayList (),
|
||||
// colInfoAl = new ArrayList ();
|
||||
// relevantOrigCols = new string[origToAlias.Count-1];
|
||||
// int c = 0;
|
||||
// ArrayList iColNames = new ArrayList (isch.columnNames);
|
||||
// iColNames.Sort ();
|
||||
// foreach (string cn in iColNames)
|
||||
// {
|
||||
// if (origToAlias.Contains (cn))
|
||||
// {
|
||||
// ColumnInfo ci = isch[cn];
|
||||
// colInfoAl.Add (new ColumnInfo (origToAlias[ci.colName] as string,
|
||||
// colInfoAl.Count,
|
||||
// ci.colType)
|
||||
// );
|
||||
// colMapAl.Add (ci.colNo);
|
||||
// if (ci.colName != "id")
|
||||
// relevantOrigCols[c++] = ci.colName;
|
||||
// }
|
||||
// }
|
||||
|
||||
// schema = new BlueTableSchema (tableName == null ? isch.tableName : tableName,
|
||||
// colInfoAl.ToArray (typeof(ColumnInfo)) as ColumnInfo[]);
|
||||
// colMap = colMapAl.ToArray (typeof(int)) as int[];
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Gets an IDictionary mapping the original names to their aliased names. (The columns
|
||||
// /// dropped do not appear in the returned value)
|
||||
// /// </summary>
|
||||
// /// <param name="isch"></param>
|
||||
// /// <param name="exp"></param>
|
||||
// static syntax myParser =
|
||||
// new syntax();
|
||||
// /// <returns></returns>
|
||||
// private static IDictionary myGetDictionary (IBlueTableSchema isch, string exp)
|
||||
// {
|
||||
// IDictionary origToAlias = new Hashtable ();
|
||||
|
||||
// ColumnMapExpression e;
|
||||
// if (DataStreamLoadFileConfig.instance.useStaticParser)
|
||||
// {
|
||||
// lock (myParser)
|
||||
// {
|
||||
// e = (ColumnMapExpression)
|
||||
// myParser.Parse(exp);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// syntax parser = new syntax();
|
||||
// e = (ColumnMapExpression)
|
||||
// myParser.Parse(exp);
|
||||
|
||||
// }
|
||||
// if (e.isInclusive)
|
||||
// {
|
||||
// origToAlias = new Hashtable (e.columns);
|
||||
// origToAlias["id"] = "id";
|
||||
// }
|
||||
// else
|
||||
// foreach (ColumnInfo ci in isch.columnInfo)
|
||||
// if (e.columns[ci.colName] == null)
|
||||
// origToAlias[ci.colName] = ci.colName;
|
||||
// else if ((string)e.columns[ci.colName] != ci.colName)
|
||||
// origToAlias[ci.colName] = e.columns[ci.colName];
|
||||
// return origToAlias;
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Returns a new dictionary with the keys and values interchanging positions
|
||||
// /// </summary>
|
||||
// /// <param name="dic"></param>
|
||||
// /// <returns></returns>
|
||||
// internal static IDictionary invertDic (IDictionary dic)
|
||||
// {
|
||||
// IDictionary retVal = new Hashtable (dic.Count);
|
||||
// foreach (DictionaryEntry de in dic)
|
||||
// retVal.Add (de.Value, de.Key);
|
||||
// return retVal;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
Reference in new issue
Block a user