How do SQL Server data types map to Spark data types when reading from SQL Server to Spark, and how does the preferTimestampNTZ option affect the mapping of SQL Server datetimes?
When reading from SQL Server to Spark, the mapping of data types is as follows:

SQL Server type | Spark type
--- | ---
bigint (unsigned), decimal, money, numeric, smallmoney | DecimalType
smallint | ShortType
int, tinyint | IntegerType
bigint (if signed) | LongType
real | FloatType
float | DoubleType
char, nchar, uniqueidentifier | CharType
nvarchar, varchar | VarcharType
text, xml | StringType
binary, geography, geometry, image, timestamp, udt, varbinary | BinaryType
bit | BooleanType
date | DateType
datetime, datetime, smalldatetime, time | TimestampType/TimestampNTZType

Regarding the mapping of SQL Server datetimes, they are mapped to Spark TimestampType by default. However, if the option preferTimestampNTZ is set to true, then SQL Server datetimes are mapped to TimestampNTZType instead.