![Microsoft Fabric - Notebook - Help - [PARSE_SYNTAX_ERROR] Syntax error at or near '*' 1 Microsoft Fabric – Notebook – Help – [PARSE_SYNTAX_ERROR] Syntax error at or near ‘*’](https://www.data-cuisine.com/wp-content/uploads/2025/05/header-image-Microsoft-Fabric-Data-Recipes.webp)
Microsoft Fabric – Notebook – Help – [PARSE_SYNTAX_ERROR] Syntax error at or near ‘*’
Lately, I have been playing around with Notebooks, Data lakehouses, and Warehouses. When I didn’t have very much experience with notebooks in Microsoft Fabric, I ran into a specific issue, which I will be describing in this data recipe.
Recipe Overview
Preparation time: 5 minutes
Introduction
As mentioned earlier, I have been playing around with Microsoft Fabric intensively in the past few months. During this period, I ran into a specific issue with one of my notebooks. What happened? Well, I was starting on a new notebook in the evening and life happened… So I stopped playing around to do something else.
A few days later, I wanted to continue my work and remembered that I was required to change something in my data load from a csv file.
![Microsoft Fabric - Notebook - Help - [PARSE_SYNTAX_ERROR] Syntax error at or near '*' 7 Screenshot of a Microsoft Fabric Notebook showing how to load data from a csv file with PySpark.](https://www.data-cuisine.com/wp-content/uploads/2025/05/image-1024x300.webp)
As you can see in the screenshot above, my dataload didn’t look “pretty”, I didn’t specify my delimiter, and I probably was required to specify the .csv data schema as well.
Therefore, I created a new code cell in my notebook to define my schema. Which looked similar to the example below.
![Microsoft Fabric - Notebook - Help - [PARSE_SYNTAX_ERROR] Syntax error at or near '*' 8 Example how to define a schema before reading a .csv file with Spark.](https://www.data-cuisine.com/wp-content/uploads/2025/05/image-4.webp)
I did notice the red squiggly line beneath the Asterisk (*), but was sure this code should work properly since I copied it from another working notebook. When executing the code cell above, I received the following error message:
[PARSE_SYNTAX_ERROR] Syntax error at or near ‘*’.(line 1, pos 30) == SQL == from pyspark.sql.types import * ——————————^^^
How to solve this error?
Since I had no clue where this issue was coming from, I started to look at what went wrong. After a couple of minutes, I figured out what was going on/wrong.
One of the things I noticed was that the code cell where I was loading my .csv into a Dataframe was working properly, but started with “%%pyspark”. This, on its own, isn’t an issue. But it provided me with something to think about.
At that point, something came back into my mind. I was creating this particular notebook to execute some tests with Spark SQL.
While reviewing my code cell where the error was occurring, I finally saw what was going wrong.
![Microsoft Fabric - Notebook - Help - [PARSE_SYNTAX_ERROR] Syntax error at or near '*' 9 Showing what is going wrong with my code cell in my Microsoft Fabric notebook.](https://www.data-cuisine.com/wp-content/uploads/2025/05/image-5-1024x299.webp)
As you can see in the screenshot above, my code cell was set to Spark SQL. Something I didn’t do intentionally. This behaviour explained to me that I changed the primary Language of my notebook.
After looking into my notebook settings, my assumption was confirmed.
![Microsoft Fabric - Notebook - Help - [PARSE_SYNTAX_ERROR] Syntax error at or near '*' 10 Screenshot showing where to change the primary language of a Microsoft Fabric Notebook](https://www.data-cuisine.com/wp-content/uploads/2025/05/image-3-1024x105.webp)
Instead of changing my primary language, I changed my code cell language to PySpark and tried to execute the code cell again.
![Microsoft Fabric - Notebook - Help - [PARSE_SYNTAX_ERROR] Syntax error at or near '*' 11 Screenshot from application » 2](https://www.data-cuisine.com/wp-content/uploads/2025/05/image-6-1024x323.webp)
Lessons learned
The most important lesson learned from this data recipe is that you need to be careful when changing the primary language of your Microsoft Fabric notebooks. My advice is to do it cautiously and only when it makes sense.