Merge pull request #371 from hebinhuang/FixBuildWarnings

Fix Build Warnings (part 5): Add XML comments and remove unused variables in Csharp code
This commit is contained in:
Renyi Xiong 2016-04-04 11:01:18 -07:00
Родитель fc2a91fb4b 61421eff8f
Коммит cdeaf2acc9
8 изменённых файлов: 467 добавлений и 9 удалений

Просмотреть файл

@ -13,6 +13,11 @@ namespace Microsoft.Spark.CSharp.Services
public class DefaultLoggerService : ILoggerService
{
internal readonly static DefaultLoggerService Instance = new DefaultLoggerService(typeof (Type));
/// <summary>
/// Get an instance of ILoggerService by a given type of logger
/// </summary>
/// <param name="type">The type of a logger to return</param>
/// <returns>An instance of ILoggerService</returns>
public ILoggerService GetLoggerInstance(Type type)
{
return new DefaultLoggerService(type);
@ -24,56 +29,105 @@ namespace Microsoft.Spark.CSharp.Services
type = t;
}
/// <summary>
/// Logs a message at debug level.
/// </summary>
/// <param name="message">The message to be logged</param>
public void LogDebug(string message)
{
Log("Debug", message);
}
/// <summary>
/// Logs a message at debug level with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
public void LogDebug(string messageFormat, params object[] messageParameters)
{
Log("Debug", string.Format(messageFormat, messageParameters));
}
/// <summary>
/// Logs a message at info level.
/// </summary>
/// <param name="message">The message to be logged</param>
public void LogInfo(string message)
{
Log("Info", message);
}
/// <summary>
/// Logs a message at info level with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
public void LogInfo(string messageFormat, params object[] messageParameters)
{
Log("Info", string.Format(messageFormat, messageParameters));
}
/// <summary>
/// Logs a message at warning level.
/// </summary>
/// <param name="message">The message to be logged</param>
public void LogWarn(string message)
{
Log("Warn", message);
}
/// <summary>
/// Logs a message at warning level with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
public void LogWarn(string messageFormat, params object[] messageParameters)
{
Log("Warn", string.Format(messageFormat, messageParameters));
}
/// <summary>
/// Logs a fatal message.
/// </summary>
/// <param name="message">The message to be logged</param>
public void LogFatal(string message)
{
Log("Fatal", message);
}
/// <summary>
/// Logs a fatal message with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
public void LogFatal(string messageFormat, params object[] messageParameters)
{
Log("Fatal", string.Format(messageFormat, messageParameters));
}
/// <summary>
/// Logs a error message.
/// </summary>
/// <param name="message">The message to be logged</param>
public void LogError(string message)
{
Log("Error", message);
}
/// <summary>
/// Logs a error message with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
public void LogError(string messageFormat, params object[] messageParameters)
{
Log("Error", string.Format(messageFormat, messageParameters));
}
/// <summary>
/// Logs an exception
/// </summary>
/// <param name="e">The exception to be logged</param>
public void LogException(Exception e)
{
Log("Exception", string.Format("{0}{1}{2}", e.Message, Environment.NewLine, e.StackTrace));

Просмотреть файл

@ -1,24 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Microsoft.Spark.CSharp.Services
{
/// <summary>
/// Defines a logger what be used in service
/// </summary>
public interface ILoggerService
{
/// <summary>
/// Get an instance of ILoggerService by a given type of logger
/// </summary>
/// <param name="type">The type of a logger to return</param>
/// <returns>An instance of ILoggerService</returns>
ILoggerService GetLoggerInstance(Type type);
/// <summary>
/// Logs a message at debug level.
/// </summary>
/// <param name="message">The message to be logged</param>
void LogDebug(string message);
/// <summary>
/// Logs a message at debug level with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
void LogDebug(string messageFormat, params object[] messageParameters);
/// <summary>
/// Logs a message at info level.
/// </summary>
/// <param name="message">The message to be logged</param>
void LogInfo(string message);
/// <summary>
/// Logs a message at info level with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
void LogInfo(string messageFormat, params object[] messageParameters);
/// <summary>
/// Logs a message at warning level.
/// </summary>
/// <param name="message">The message to be logged</param>
void LogWarn(string message);
/// <summary>
/// Logs a message at warning level with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
void LogWarn(string messageFormat, params object[] messageParameters);
/// <summary>
/// Logs a fatal message.
/// </summary>
/// <param name="message">The message to be logged</param>
void LogFatal(string message);
/// <summary>
/// Logs a fatal message with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
void LogFatal(string messageFormat, params object[] messageParameters);
/// <summary>
/// Logs a error message.
/// </summary>
/// <param name="message">The message to be logged</param>
void LogError(string message);
/// <summary>
/// Logs a error message with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
void LogError(string messageFormat, params object[] messageParameters);
/// <summary>
/// Logs an exception
/// </summary>
/// <param name="e">The exception to be logged</param>
void LogException(Exception e);
}
}

Просмотреть файл

@ -10,11 +10,17 @@ using log4net.Config;
namespace Microsoft.Spark.CSharp.Services
{
[ExcludeFromCodeCoverage] //unit test coverage not reqiured for logger service
/// <summary>
/// Represents a Log4Net logger.
/// </summary>
[ExcludeFromCodeCoverage] //unit test coverage not required for logger service
public class Log4NetLoggerService : ILoggerService
{
private readonly ILog logger;
private const string exceptionLogDelimiter = "*******************************************************************************************************************************";
/// <summary>
/// Gets a instance of Log4Net logger
/// </summary>
public static Log4NetLoggerService Instance = new Log4NetLoggerService(typeof(Type));
static Log4NetLoggerService()
@ -22,62 +28,115 @@ namespace Microsoft.Spark.CSharp.Services
XmlConfigurator.Configure();
}
/// <summary>
/// Initializes a instance of Log4NetLoggerService with a specific type.
/// </summary>
/// <param name="type">The type of the logger</param>
public Log4NetLoggerService(Type type)
{
logger = LogManager.GetLogger(type);
log4net.GlobalContext.Properties["pid"] = Process.GetCurrentProcess().Id;
}
/// <summary>
/// Logs a message at debug level.
/// </summary>
/// <param name="message">The message to be logged</param>
public void LogDebug(string message)
{
logger.Debug(message);
}
/// <summary>
/// Logs a message at debug level with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
public void LogDebug(string messageFormat, params object[] messageParameters)
{
logger.DebugFormat(messageFormat, messageParameters);
}
/// <summary>
/// Logs a message at info level.
/// </summary>
/// <param name="message">The message to be logged</param>
public void LogInfo(string message)
{
logger.Info(message);
}
/// <summary>
/// Logs a message at info level with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
public void LogInfo(string messageFormat, params object[] messageParameters)
{
logger.InfoFormat(messageFormat, messageParameters);
}
/// <summary>
/// Logs a message at warning level.
/// </summary>
/// <param name="message">The message to be logged</param>
public void LogWarn(string message)
{
logger.Warn(message);
}
/// <summary>
/// Logs a message at warning level with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
public void LogWarn(string messageFormat, params object[] messageParameters)
{
logger.WarnFormat(messageFormat, messageParameters);
}
/// <summary>
/// Logs a fatal message.
/// </summary>
/// <param name="message">The message to be logged</param>
public void LogFatal(string message)
{
logger.Fatal(message);
}
/// <summary>
/// Logs a fatal message with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
public void LogFatal(string messageFormat, params object[] messageParameters)
{
logger.FatalFormat(messageFormat, messageParameters);
}
/// <summary>
/// Logs a error message.
/// </summary>
/// <param name="message">The message to be logged</param>
public void LogError(string message)
{
logger.Error(message);
}
/// <summary>
/// Logs a error message with a format string.
/// </summary>
/// <param name="messageFormat">The format string</param>
/// <param name="messageParameters">The array of arguments</param>
public void LogError(string messageFormat, params object[] messageParameters)
{
logger.ErrorFormat(messageFormat, messageParameters);
}
/// <summary>
/// Logs an exception
/// </summary>
/// <param name="e">The exception to be logged</param>
public void LogException(Exception e)
{
@ -117,7 +176,12 @@ namespace Microsoft.Spark.CSharp.Services
}
}
/// <summary>
/// Get an instance of ILoggerService by a given type of logger
/// </summary>
/// <param name="type">The type of a logger to return</param>
/// <returns>An instance of ILoggerService</returns>
public ILoggerService GetLoggerInstance(Type type)
{
return new Log4NetLoggerService(type);

Просмотреть файл

@ -13,6 +13,10 @@ namespace Microsoft.Spark.CSharp.Services
{
private static ILoggerService loggerService = DefaultLoggerService.Instance;
/// <summary>
/// Overrides an existing logger by a given logger service instance
/// </summary>
/// <param name="loggerServiceOverride">The logger service instance used to overrides</param>
public static void SetLoggerService(ILoggerService loggerServiceOverride)
{
loggerService = loggerServiceOverride;
@ -20,6 +24,11 @@ namespace Microsoft.Spark.CSharp.Services
logger.LogInfo("Logger service configured to use {0}", logger.GetType().Name);
}
/// <summary>
/// Gets an instance of logger service for a given type.
/// </summary>
/// <param name="type">The type of logger service to get</param>
/// <returns>An instance of logger service</returns>
public static ILoggerService GetLogger(Type type)
{
return loggerService.GetLoggerInstance(type);

Просмотреть файл

@ -62,7 +62,7 @@ namespace Microsoft.Spark.CSharp.Sql
}
/// <summary>
/// Subtraction of this expresion and another expression.
/// Subtraction of this expression and another expression.
/// </summary>
/// <param name="self">The column self to compute</param>
/// <param name="other">The other object to compute</param>

Просмотреть файл

@ -2689,11 +2689,279 @@
Right now it just prints out the messages to Console
</summary>
</member>
<member name="T:Microsoft.Spark.CSharp.Services.ILoggerService">
<summary>
Defines a logger what be used in service
</summary>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.GetLoggerInstance(System.Type)">
<summary>
Get an instance of ILoggerService by a given type of logger
</summary>
<param name="type">The type of a logger to return</param>
<returns>An instance of ILoggerService</returns>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogDebug(System.String)">
<summary>
Logs a message at debug level.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogDebug(System.String,System.Object[])">
<summary>
Logs a message at debug level with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogInfo(System.String)">
<summary>
Logs a message at info level.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogInfo(System.String,System.Object[])">
<summary>
Logs a message at info level with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogWarn(System.String)">
<summary>
Logs a message at warning level.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogWarn(System.String,System.Object[])">
<summary>
Logs a message at warning level with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogFatal(System.String)">
<summary>
Logs a fatal message.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogFatal(System.String,System.Object[])">
<summary>
Logs a fatal message with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogError(System.String)">
<summary>
Logs a error message.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogError(System.String,System.Object[])">
<summary>
Logs a error message with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.ILoggerService.LogException(System.Exception)">
<summary>
Logs an exception
</summary>
<param name="e">The exception to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.GetLoggerInstance(System.Type)">
<summary>
Get an instance of ILoggerService by a given type of logger
</summary>
<param name="type">The type of a logger to return</param>
<returns>An instance of ILoggerService</returns>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogDebug(System.String)">
<summary>
Logs a message at debug level.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogDebug(System.String,System.Object[])">
<summary>
Logs a message at debug level with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogInfo(System.String)">
<summary>
Logs a message at info level.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogInfo(System.String,System.Object[])">
<summary>
Logs a message at info level with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogWarn(System.String)">
<summary>
Logs a message at warning level.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogWarn(System.String,System.Object[])">
<summary>
Logs a message at warning level with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogFatal(System.String)">
<summary>
Logs a fatal message.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogFatal(System.String,System.Object[])">
<summary>
Logs a fatal message with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogError(System.String)">
<summary>
Logs a error message.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogError(System.String,System.Object[])">
<summary>
Logs a error message with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.DefaultLoggerService.LogException(System.Exception)">
<summary>
Logs an exception
</summary>
<param name="e">The exception to be logged</param>
</member>
<member name="T:Microsoft.Spark.CSharp.Services.Log4NetLoggerService">
<summary>
Represents a Log4Net logger.
</summary>
</member>
<member name="F:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.Instance">
<summary>
Gets a instance of Log4Net logger
</summary>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.#ctor(System.Type)">
<summary>
Initializes a instance of Log4NetLoggerService with a specific type.
</summary>
<param name="type">The type of the logger</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogDebug(System.String)">
<summary>
Logs a message at debug level.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogDebug(System.String,System.Object[])">
<summary>
Logs a message at debug level with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogInfo(System.String)">
<summary>
Logs a message at info level.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogInfo(System.String,System.Object[])">
<summary>
Logs a message at info level with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogWarn(System.String)">
<summary>
Logs a message at warning level.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogWarn(System.String,System.Object[])">
<summary>
Logs a message at warning level with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogFatal(System.String)">
<summary>
Logs a fatal message.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogFatal(System.String,System.Object[])">
<summary>
Logs a fatal message with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogError(System.String)">
<summary>
Logs a error message.
</summary>
<param name="message">The message to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogError(System.String,System.Object[])">
<summary>
Logs a error message with a format string.
</summary>
<param name="messageFormat">The format string</param>
<param name="messageParameters">The array of arguments</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.LogException(System.Exception)">
<summary>
Logs an exception
</summary>
<param name="e">The exception to be logged</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.Log4NetLoggerService.GetLoggerInstance(System.Type)">
<summary>
Get an instance of ILoggerService by a given type of logger
</summary>
<param name="type">The type of a logger to return</param>
<returns>An instance of ILoggerService</returns>
</member>
<member name="T:Microsoft.Spark.CSharp.Services.LoggerServiceFactory">
<summary>
Used to get logger service instances for different types
</summary>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.LoggerServiceFactory.SetLoggerService(Microsoft.Spark.CSharp.Services.ILoggerService)">
<summary>
Overrides an existing logger by a given logger service instance
</summary>
<param name="loggerServiceOverride">The logger service instance used to overrides</param>
</member>
<member name="M:Microsoft.Spark.CSharp.Services.LoggerServiceFactory.GetLogger(System.Type)">
<summary>
Gets an instance of logger service for a given type.
</summary>
<param name="type">The type of logger service to get</param>
<returns>An instance of logger service</returns>
</member>
<member name="T:Microsoft.Spark.CSharp.Sql.Column">
<summary>
A column that will be computed based on the data in a DataFrame.
@ -2723,7 +2991,7 @@
</member>
<member name="M:Microsoft.Spark.CSharp.Sql.Column.op_Subtraction(Microsoft.Spark.CSharp.Sql.Column,System.Object)">
<summary>
Subtraction
Subtraction of this expression and another expression.
</summary>
<param name="self">The column self to compute</param>
<param name="other">The other object to compute</param>

Просмотреть файл

@ -331,7 +331,7 @@
####Methods
<table><tr><th>Name</th><th>Description</th></tr><tr><td><font color="blue">op_LogicalNot</font></td><td>The logical negation operator that negates its operand.</td></tr><tr><td><font color="blue">op_UnaryNegation</font></td><td>Negation of itself.</td></tr><tr><td><font color="blue">op_Addition</font></td><td>Sum of this expression and another expression.</td></tr><tr><td><font color="blue">op_Subtraction</font></td><td>Subtraction</td></tr><tr><td><font color="blue">op_Multiply</font></td><td>Multiplication of this expression and another expression.</td></tr><tr><td><font color="blue">op_Division</font></td><td>Division this expression by another expression.</td></tr><tr><td><font color="blue">op_Modulus</font></td><td>Modulo (a.k.a. remainder) expression.</td></tr><tr><td><font color="blue">op_Equality</font></td><td>The equality operator returns true if the values of its operands are equal, false otherwise.</td></tr><tr><td><font color="blue">op_Inequality</font></td><td>The inequality operator returns false if its operands are equal, true otherwise.</td></tr><tr><td><font color="blue">op_LessThan</font></td><td>The "less than" relational operator that returns true if the first operand is less than the second, false otherwise.</td></tr><tr><td><font color="blue">op_LessThanOrEqual</font></td><td>The "less than or equal" relational operator that returns true if the first operand is less than or equal to the second, false otherwise.</td></tr><tr><td><font color="blue">op_GreaterThanOrEqual</font></td><td>The "greater than or equal" relational operator that returns true if the first operand is greater than or equal to the second, false otherwise.</td></tr><tr><td><font color="blue">op_GreaterThan</font></td><td>The "greater than" relational operator that returns true if the first operand is greater than the second, false otherwise.</td></tr><tr><td><font color="blue">op_BitwiseOr</font></td><td>Compute bitwise OR of this expression with another expression.</td></tr><tr><td><font color="blue">op_BitwiseAnd</font></td><td>Compute bitwise AND of this expression with another expression.</td></tr><tr><td><font color="blue">op_ExclusiveOr</font></td><td>Compute bitwise XOR of this expression with another expression.</td></tr><tr><td><font color="blue">GetHashCode</font></td><td>Required when operator == or operator != is defined</td></tr><tr><td><font color="blue">Equals</font></td><td>Required when operator == or operator != is defined</td></tr><tr><td><font color="blue">Like</font></td><td>SQL like expression.</td></tr><tr><td><font color="blue">RLike</font></td><td>SQL RLIKE expression (LIKE with Regex).</td></tr><tr><td><font color="blue">StartsWith</font></td><td>String starts with another string literal.</td></tr><tr><td><font color="blue">EndsWith</font></td><td>String ends with another string literal.</td></tr><tr><td><font color="blue">Asc</font></td><td>Returns a sort expression based on the ascending order.</td></tr><tr><td><font color="blue">Desc</font></td><td>Returns a sort expression based on the descending order.</td></tr><tr><td><font color="blue">Alias</font></td><td>Returns this column aliased with a new name.</td></tr><tr><td><font color="blue">Alias</font></td><td>Returns this column aliased with new names</td></tr><tr><td><font color="blue">Cast</font></td><td>Casts the column to a different data type, using the canonical string representation of the type. The supported types are: `string`, `boolean`, `byte`, `short`, `int`, `long`, `float`, `double`, `decimal`, `date`, `timestamp`. E.g. // Casts colA to integer. df.select(df("colA").cast("int"))</td></tr></table>
<table><tr><th>Name</th><th>Description</th></tr><tr><td><font color="blue">op_LogicalNot</font></td><td>The logical negation operator that negates its operand.</td></tr><tr><td><font color="blue">op_UnaryNegation</font></td><td>Negation of itself.</td></tr><tr><td><font color="blue">op_Addition</font></td><td>Sum of this expression and another expression.</td></tr><tr><td><font color="blue">op_Subtraction</font></td><td>Subtraction of this expression and another expression.</td></tr><tr><td><font color="blue">op_Multiply</font></td><td>Multiplication of this expression and another expression.</td></tr><tr><td><font color="blue">op_Division</font></td><td>Division this expression by another expression.</td></tr><tr><td><font color="blue">op_Modulus</font></td><td>Modulo (a.k.a. remainder) expression.</td></tr><tr><td><font color="blue">op_Equality</font></td><td>The equality operator returns true if the values of its operands are equal, false otherwise.</td></tr><tr><td><font color="blue">op_Inequality</font></td><td>The inequality operator returns false if its operands are equal, true otherwise.</td></tr><tr><td><font color="blue">op_LessThan</font></td><td>The "less than" relational operator that returns true if the first operand is less than the second, false otherwise.</td></tr><tr><td><font color="blue">op_LessThanOrEqual</font></td><td>The "less than or equal" relational operator that returns true if the first operand is less than or equal to the second, false otherwise.</td></tr><tr><td><font color="blue">op_GreaterThanOrEqual</font></td><td>The "greater than or equal" relational operator that returns true if the first operand is greater than or equal to the second, false otherwise.</td></tr><tr><td><font color="blue">op_GreaterThan</font></td><td>The "greater than" relational operator that returns true if the first operand is greater than the second, false otherwise.</td></tr><tr><td><font color="blue">op_BitwiseOr</font></td><td>Compute bitwise OR of this expression with another expression.</td></tr><tr><td><font color="blue">op_BitwiseAnd</font></td><td>Compute bitwise AND of this expression with another expression.</td></tr><tr><td><font color="blue">op_ExclusiveOr</font></td><td>Compute bitwise XOR of this expression with another expression.</td></tr><tr><td><font color="blue">GetHashCode</font></td><td>Required when operator == or operator != is defined</td></tr><tr><td><font color="blue">Equals</font></td><td>Required when operator == or operator != is defined</td></tr><tr><td><font color="blue">Like</font></td><td>SQL like expression.</td></tr><tr><td><font color="blue">RLike</font></td><td>SQL RLIKE expression (LIKE with Regex).</td></tr><tr><td><font color="blue">StartsWith</font></td><td>String starts with another string literal.</td></tr><tr><td><font color="blue">EndsWith</font></td><td>String ends with another string literal.</td></tr><tr><td><font color="blue">Asc</font></td><td>Returns a sort expression based on the ascending order.</td></tr><tr><td><font color="blue">Desc</font></td><td>Returns a sort expression based on the descending order.</td></tr><tr><td><font color="blue">Alias</font></td><td>Returns this column aliased with a new name.</td></tr><tr><td><font color="blue">Alias</font></td><td>Returns this column aliased with new names</td></tr><tr><td><font color="blue">Cast</font></td><td>Casts the column to a different data type, using the canonical string representation of the type. The supported types are: `string`, `boolean`, `byte`, `short`, `int`, `long`, `float`, `double`, `decimal`, `date`, `timestamp`. E.g. // Casts colA to integer. df.select(df("colA").cast("int"))</td></tr></table>
---

Просмотреть файл

@ -16,11 +16,21 @@ namespace Microsoft.Spark.CSharp.Examples
* Following connection parameters to EventHub need to
* be set appropriately before publishing
*****************************************************/
/*
private static readonly string EventHubName = "<name>";
*/
/*
private static readonly string Namespace = "<namespace>";
*/
/*
private static readonly string KeyName = "<keyname>";
*/
/*
private static readonly string Key = "<key>";
*/
/*
private static readonly string ConnectionStringFormat = "Endpoint=sb://{0}.servicebus.windows.net/;SharedAccessKeyName={1};SharedAccessKey={2}";
*/
private static readonly string[] LogLevels = { "Info", "Debug", "Error", "Fatal" };
private static readonly Random RandomLogLevel = new Random();