|
| 1 | +# .NET for Apache Spark C# Samples |
| 2 | + |
| 3 | +[.NET for Apache Spark](https://dot.net/spark) is a free, open-source, and cross-platform big data analytics framework. |
| 4 | + |
| 5 | +In the **Microsoft.Spark.CSharp.Examples** folder, we provide C# samples which will help you get started with .NET for Apache Spark |
| 6 | +and demonstrate how to infuse big data analytics into existing and new .NET apps. |
| 7 | + |
| 8 | +There are three main types of samples/apps in the repo: |
| 9 | + |
| 10 | +* **[SQL/Batch](Sql/Batch):** .NET for Apache Spark apps that analyze batch data, or data that has already been produced/stored. |
| 11 | + |
| 12 | +* **[SQL/Streaming](Sql/Streaming):** .NET for Apache Spark apps that analyze structured streaming data, or data that is currently being produced live. |
| 13 | + |
| 14 | +* **[Machine Learning](MachineLearning):** .NET for Apache Spark apps infused with Machine Learning models based on [ML.NET](http://dot.net/ml), |
| 15 | +an open source and cross-platform machine learning framework. |
| 16 | + |
| 17 | +<table > |
| 18 | + <tr> |
| 19 | + <td align="middle" colspan="2"><b>Batch Processing</td> |
| 20 | + </tr> |
| 21 | + <tr> |
| 22 | + <td align="middle"><a href="Sql/Batch/Basic.cs"><b>Basic.cs</a></b><br>A simple example demonstrating basic Spark SQL features.<br></td> |
| 23 | + <td align="middle"><a href="Sql/Batch/Datasource.cs"><b>Datasource.cs</a></b><br>Example demonstrating reading from various data sources.<br></td> |
| 24 | + </tr> |
| 25 | + <tr> |
| 26 | + <td align="middle"><a href="Sql/Batch/GitHubProjects.cs"><b>GitHubProjects.cs</a></b><br>Example analyzing GitHub projects data.<br></td> |
| 27 | + <td align="middle"><a href="Sql/Batch/Logging.cs"><b>Logging.cs</a></b><br>Example demonstrating log processing.<br></td> |
| 28 | + </tr> |
| 29 | + <tr> |
| 30 | + <td align="middle"><a href="Sql/Batch/VectorUdfs.cs"><b>VectorUdfs.cs</a></b><br>Example using vectorized UDFs to improve query performance.<br></td> |
| 31 | + </tr> |
| 32 | +</table> |
| 33 | + |
| 34 | +<br> |
| 35 | + |
| 36 | +<table > |
| 37 | + <tr> |
| 38 | + <td align="middle" colspan="2"><b>Structured Streaming</td> |
| 39 | + </tr> |
| 40 | + <tr> |
| 41 | + <td align="middle"><a href="Sql/Streaming/StructuredNetworkWordCount.cs"><b>StructuredNetworkWordCount.cs</a></b><br>Simple word count app that connects to and analyzes a live data stream (like netcat).<br></td> |
| 42 | + <td align="middle"><a href="Sql/Streaming/StructuredNetworkWordCountWindowed.cs"><b>StructuredNetworkWordCountWindowed.cs</a></b><br>Windowed word count app.<br></td> |
| 43 | + </tr> |
| 44 | + <tr> |
| 45 | + <td align="middle"><a href="Sql/Streaming/StructuredKafkaWordCount.cs"><b>StructuredKafkaWordCount.cs</a></b><br>Word count on data from Kafka.<br></td> |
| 46 | + <td align="middle"><a href="Sql/Streaming/StructuredNetworkCharacterCount.cs"><b>StructuredNetworkCharacterCount.cs</a></b><br>Count number of characters in each string read from a stream, demonstrating the power of UDFs + stream processing.<br></td> |
| 47 | + </tr> |
| 48 | +</table> |
| 49 | + |
| 50 | +<br> |
| 51 | + |
| 52 | +<table > |
| 53 | + <tr> |
| 54 | + <td align="middle" colspan="2"><b>Machine Learning</td> |
| 55 | + </tr> |
| 56 | + <tr> |
| 57 | + <td align="middle"><a href="MachineLearning/Sentiment/Program.cs"><b>Batch Sentiment Analysis</a></b><br>Determine if a batch of online reviews are positive or negative, using ML.NET.<br></td> |
| 58 | + <td align="middle"><a href="MachineLearning/SentimentStream/Program.cs"><b>Streaming Sentiment Analysis</a></b><br>Determine if statements being produced live are positive or negative, using ML.NET.<br></td> |
| 59 | + </tr> |
| 60 | +</table> |
| 61 | + |
| 62 | +### Other Files in the Folder |
| 63 | + |
| 64 | +Beyond the sample apps, there are a few other files in the **Microsoft.Spark.CSharp.Examples** folder: |
| 65 | + |
| 66 | +* **IExample.cs:** A common interface each sample implements to help provide consistency when creating/running sample apps. |
| 67 | +> Note: When you create and run sample apps beyond this repository's project, you do not need to use IExample.cs - it just provides consistency for all the apps included in this repo. |
| 68 | +
|
| 69 | +* **Microsoft.Spark.CSharp.Examples.csproj:** The C# project file necessary for building/running all sample apps. It includes target |
| 70 | +frameworks, assembly information, and references to other C# project files references in the sample apps. |
| 71 | + |
| 72 | +* **Program.cs:** A common entry-point when running our sample apps (it contains the Main method). Helps us print error messages in cases such as a project lacking the necessary arguments. |
| 73 | + |
| 74 | +* **README.md:** The doc you are currently reading. |
0 commit comments