Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

apache-spark-sql

Convert pyspark string to date format

August 21, 2022 by Magenaut

I have a date pyspark dataframe with a string column in the format of MM-dd-yyyy and I am attempting to convert this into a date column.

Categories Python, Q&A Tags apache-spark, apache-spark-sql, pyspark, python Leave a comment

How to split Vector into columns – using PySpark

August 21, 2022 by Magenaut

Context: I have a DataFrame with 2 columns: word and vector. Where the column type of “vector” is VectorUDT.

Categories Python, Q&A Tags apache-spark, apache-spark-ml, apache-spark-sql, pyspark, python Leave a comment

How to add a constant column in a Spark DataFrame?

August 20, 2022 by Magenaut

I want to add a column in a DataFrame with some arbitrary value (that is the same for each row). I get an error when I use withColumn as follows:

Categories Python, Q&A Tags apache-spark, apache-spark-sql, dataframe, pyspark, python Leave a comment

How to use JDBC source to write and read data in (Py)Spark?

August 20, 2022 by Magenaut

The goal of this question is to document:

Categories Python, Q&A Tags apache-spark, apache-spark-sql, pyspark, python, scala Leave a comment

Load CSV file with Spark

August 19, 2022 by Magenaut

I’m new to Spark and I’m trying to read CSV data from a file with Spark.
Here’s what I am doing :

Categories Python, Q&A Tags apache-spark, apache-spark-sql, csv, pyspark, python Leave a comment

Spark Dataframe distinguish columns with duplicated name

August 18, 2022 by Magenaut

So as I know in Spark Dataframe, that for multiple columns can have the same name as shown in below dataframe snapshot:

Categories Python, Q&A Tags apache-spark, apache-spark-sql, dataframe, pyspark, python Leave a comment

How to change a dataframe column from String type to Double type in PySpark?

August 18, 2022 by Magenaut

I have a dataframe with column as String.
I wanted to change the column type to Double type in PySpark.

Categories Python, Q&A Tags apache-spark, apache-spark-sql, dataframe, pyspark, python Leave a comment

How to change dataframe column names in pyspark?

August 18, 2022 by Magenaut

I come from pandas background and am used to reading data from CSV files into a dataframe and then simply changing the column names to something useful using the simple command:

Categories Python, Q&A Tags apache-spark, apache-spark-sql, pyspark, python Leave a comment

How to perform union on two DataFrames with different amounts of columns in spark?

August 17, 2022 by Magenaut

I have 2 DataFrames:

Categories Python, Q&A Tags apache-spark, apache-spark-sql, pyspark, pyspark-dataframes, python Leave a comment

Pyspark: Split multiple array columns into rows

August 17, 2022 by Magenaut

I have a dataframe which has one row, and several columns. Some of the columns are single values, and others are lists. All list columns are the same length. I want to split each list column into a separate row, while keeping any non-list column as is.

Categories Python, Q&A Tags apache-spark, apache-spark-sql, dataframe, pyspark, python Leave a comment
Older posts
Page1 Page2 Page3 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress